Fieldset

Related fields under one legend, disabled together when the set is.

01Preview

01
Full screen
Billing details

02Installation

npx shadcn@latest add https://aiellie.app/r/fieldset.json

03API reference

02
From the Base UI documentation

Groups a shared legend with related controls. Renders a <fieldset> element.

Props

PropTypeDefaultDescription
classNamestring | ((state: Fieldset.Root.State) => string | undefined)-CSS class applied to the element, or a function that returns a class based on the component's state.
styleReact.CSSProperties | ((state: Fieldset.Root.State) => React.CSSProperties | undefined)-Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement | ((props: HTMLProps, state: Fieldset.Root.State) => ReactElement)-Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.