Surface override; defaults to the nearest provider.
variant
'solid' | 'soft' | 'ghost' | 'outline'
'solid'
solid and soft fill; outline and ghost stay transparent.
padding
'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
'md'
Padding scale.
radius
'none' | 'sm' | 'md' | 'lg' | 'full'
—
Fixed radius; the surface's large radius when unset.
border
boolean
—
Whether to render a border. Defaults to true when variant === 'outline' (outlines without a border are meaningless), false otherwise. Pass true to force a border on solid/soft/ghost; pass false to force-off on outline. Note: when polymorphic as is a landmark element (section, nav, aside, main), supply aria-label or aria-labelledby for a11y.
shadow
boolean
false
Surface drop shadow. On pixel it shows with a radius only: the default corners are cut, and a drop shadow cannot show past them.
Also takes the native attributes and event handlers of <div> (HTMLAttributes<HTMLDivElement>), except color.
ref points to <div>.
Accessibility
WCAG target: 2.1 AA
unopinionated-polymorphic-surface
Inherits semantics from the as element. When as is a landmark (section, nav, aside, main), provide aria-label or aria-labelledby for an accessible name.