new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

shadcn/ui · Components · all subjects

tooltip/usage

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Tooltip import statement

Import the Tooltip and TooltipTrigger components using: import { Tooltip, TooltipTrigger } from "@/components/ui/tooltip"

Basic Tooltip usage example

Wrap a Button in a TooltipTrigger and place a Tooltip component inside to display content on hover or focus. Example: <TooltipTrigger> <Button>Hover</Button> <Tooltip> <p>Add to library</p> </Tooltip> </TooltipTrigger>

Basic Tooltip component structure

The basic Tooltip structure uses the following code: <Tooltip><TooltipTrigger>Hover</TooltipTrigger><TooltipContent><p>Add to library</p></TooltipContent></Tooltip>

Tooltip with disabled button pattern

To show a tooltip on a disabled button, wrap the disabled button with a span element, then place the Tooltip around the span.

Tooltip basic imports

To use the Tooltip component, import the following from @/components/ui/tooltip: Tooltip, TooltipContent, and TooltipTrigger.

Tooltip basic usage example

This example demonstrates basic tooltip usage: ```tsx <Tooltip> <TooltipTrigger>Hover</TooltipTrigger> <TooltipContent> <p>Add to library</p> </TooltipContent> </Tooltip> ``` The TooltipTrigger element becomes interactive and shows the TooltipContent when hovered or focused.

Tooltip on disabled button workaround

To show a tooltip on a disabled button, wrap the button with a span element. This allows the tooltip to function properly since disabled buttons do not receive keyboard focus or hover events.

Give your agent this brain