Toggle API
Every prop of Toggle, plus the 1 symbol it exports alongside them, generated from the package manifest.
import { Toggle } from '@oceanic-hub/brand-system'- Layer
- core — shadcn-derived primitives.
- Exports
- Togglealso: toggleVariantstypes: ToggleOwnProps · ToggleShape
- Variants
- variant: default | outline
- size: sm | md | lg
- shape: default | pill
- Contract
- packages/brand-system/src/components/toggle.contract.test-d.ts
- Demos
- 5 on the Toggle page — rendered live, hydrated
- Source
- packages/brand-system/src/components/toggle.tsx
Generated from manifest/component-manifest.json, so it cannot drift from the source. For what Toggle is for, how it composes and what it looks like, see Toggle.
Toggle
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & ToggleOwnProps
Prop
Type
Also inherited from @radix-ui/react-toggle — forwarded, not declared here, and accepted alongside the props above. DOM attributes are accepted too and omitted here.
Prop
Type
toggleVariants
A cva class builder. It returns the class string for a set of variants, so a foreign element can wear this component's surface — a link styled as a button, an AlertDialogAction styled as a destructive one. An advanced move: reach for the component first.
(props?: ({ variant?: "default" | "outline" | null | undefined; size?: "sm" | "md" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined): stringParameters
Prop
Type
Variant axes
Read off the component's own cva config, so this table and the parts that consume it cannot disagree.
Prop
Type