Is your feature request related to a problem? Please describe.
Currently, BBBHint requires consumers to manage external state (e.g. useState) just to control the open/close behavior. This is verbose and unnecessary for simple use cases where the default behavior — closing when the X button is clicked — is already sufficient.
Describe the solution you'd like
BBBHint should infer uncontrolled mode when no open or onClose props are provided. In that case, clicking the X button should automatically close the hint without requiring any external state in the consumer.
Describe alternatives you've considered
Keep the current fully controlled behavior and document a helper hook (e.g. useBBBHintState) that wraps useState to reduce boilerplate. However, this would still require extra code on the consumer side.
Affected component
BBBHint
Proposed API / Usage Example
// Uncontrolled mode — no external state needed
<BBBHint content="Important tip!">
<BBBButton>Help</BBBButton>
</BBBHint>
// Controlled mode still works as expected
const [open, setOpen] = useState(false);
<BBBHint open={open} onClose={() => setOpen(false)} content="Important tip!">
<BBBButton>Help</BBBButton>
</BBBHint>
Additional context
The change must be backward compatible. The current controlled behavior should continue to work normally when open and onClose are provided.
Is your feature request related to a problem? Please describe.
Currently,
BBBHintrequires consumers to manage external state (e.g.useState) just to control the open/close behavior. This is verbose and unnecessary for simple use cases where the default behavior — closing when the X button is clicked — is already sufficient.Describe the solution you'd like
BBBHintshould infer uncontrolled mode when noopenoronCloseprops are provided. In that case, clicking the X button should automatically close the hint without requiring any external state in the consumer.Describe alternatives you've considered
Keep the current fully controlled behavior and document a helper hook (e.g.
useBBBHintState) that wrapsuseStateto reduce boilerplate. However, this would still require extra code on the consumer side.Affected component
BBBHintProposed API / Usage Example
Additional context
The change must be backward compatible. The current controlled behavior should continue to work normally when
openandonCloseare provided.