Skip to content
llms.txt
llms.txt

Styling floating surfaces

The package owns interaction state and geometry. Your application owns the surface markup, visual tokens, and responsive layout. This separation keeps a tooltip, sheet, toast, or command palette consistent without forcing one visual design on every product.

The Styling group collects the decisions that are specific to floating UI:

For a complete close lifecycle, see Entry and exit animation. The Sheet, Toast, and Command demos show these patterns in context.

Use package state to answer “is it open, dismissed, or active?” and CSS to answer “where should it appear, how large is it, and how should it move?”

.surface {
/* application-owned design tokens */
--surface-radius: 0.75rem;
--surface-shadow: 0 18px 50px rgb(15 23 42 / 0.18);
border-radius: var(--surface-radius);
box-shadow: var(--surface-shadow);
}

Avoid conditional rendering that removes a native surface before its close transition can run. Keep it mounted and let Floating UI Plus apply hidden after the browser transition (or after FloatingTransition for a custom presence surface).