A component that displays floating content relative to a target element.
Guidelines
React API Reference
Blazor API Reference
Popovers display additional content or options related to a specific UI element. Triggered by user actions like clicking or hovering, they offer extra information without moving the user away from their current context.
Capitalization and Punctuation:
Follow sentence case with proper punctuation. Keep text concise and grammatically correct.Active Voice and Clarity:
Use active voice and avoid jargon. If complex terms are necessary, provide brief explanations.
Provide extra information or options that enhance the user’s current task.
Keep popover text short and easy to scan.
Don't
Use popovers for critical or essential information that must be seen immediately.
Overwhelm users with lengthy text or unnecessary details.
1
Import
Copy
Ask AI
import { Popover, PopoverContent, PopoverTrigger,} from '@strongtie/design-system/popover'
2
Usage
Copy
Ask AI
export function PopoverDemo() { return ( <Popover> <PopoverTrigger>Open</PopoverTrigger> <PopoverContent> This is a Popover. Place content for the popover here. </PopoverContent> </Popover> ) }
The modality of the popover. When set to true, interaction with outside elements will be disabled and only popover content will be visible to screen readers.
The button that toggles the popover. By default, the StudsPopoverTrigger will render a button element. This component inherits props from the Radix UI Popover Trigger component.
The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check.
The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object
The sticky behavior on the align axis. “partial” will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst “always” will keep the content in the boundary regardless.
<Popover> <PopoverTrigger>Click me</PopoverTrigger> <PopoverContent> <div> <h4>Basic Popover</h4> <p>This is a simple popover with some content.</p> </div> </PopoverContent></Popover>