c2-radio is one option: a native <input type="radio"> with its label beside it and an optional description slot underneath. c2-radio-group turns several of them into a single control with one value and one name, disables them together, and restores the native keyboard model across the shadow boundary: Arrow keys move and select, and only the selected option is a tab stop. Radios can sit anywhere inside the group, including in wrapper elements. Standalone radios sharing a name in the same root still uncheck each other, but only the group provides arrow-key navigation and a single change event with the new value.
Installation
npm install @c2n/radio
Importing @c2n/radio registers both c2-radio-group and c2-radio.
Usage
Plan
MonthlyYearly
ShippingDelivery estimates are for business days.Standard3–5 days, free over $50Express1–2 days, $9Store pickupReady in 2 hours
EnabledChecked and disabledDisabledWhole group disabledOneTwo
FreeFor personal projectsProUnlimited projects, priority supportTeamShared workspaces and SSO
Set the group’s value to select an option from code, or set checked on a radio: the group adopts it and unchecks the rest. Listen for change on the group (detail.value); the options’ own change events are stopped at the group so a listener above it hears exactly one event per selection. Every option needs a value, and an option without a checked sibling leaves the group value empty.
The inner inputs live in shadow roots, so they do not take part in a surrounding <form>; read value from the group on submit or mirror it into a hidden input. The label slot names the group for assistive technology (aria-label works too); give a standalone radio without visible text an aria-label.
The indicator is not tied to the ring. --c2-radio__control--border-radius reshapes the ring and its dot (a square control at 4px); the dot slot replaces the filled dot with a mark such as a check, drawn in --c2-radio__dot--color; and the icon and checked-icon slots replace the whole control with an icon per state, coloured by --c2-radio__icon--color and --c2-radio__icon__checked--color and sized by --c2-radio__icon--size. With only icon, the same icon shows in both states and changes colour; with only checked-icon, the ring stays for the unchecked state. Hide that ring with --c2-radio__control--border: none and move the indicator after the text with --c2-radio__container--flex-direction: row-reverse to get a menu-style check list, as in the row above.
Theme the control with --c2-radio__control--* and --c2-radio__dot--* (an accent border with a transparent fill gives the outlined look), the text with --c2-radio__label--* and --c2-radio__description--*, and the whole row with --c2-radio__container--* for card-style options. Set those variables on the group and every option inherits them, as in the Cards row above; add --c2-radio-group--align-items: stretch so the cards fill the width.
c2-radio is one option: a native <input type="radio"> with its label beside it and an optional description slot underneath. c2-radio-group turns several of them into a single control with one value and one name, disables them together, and restores the native keyboard model across the shadow boundary: Arrow keys move and select, and only the selected option is a tab stop. Radios can sit anywhere inside the group, including in wrapper elements. Standalone radios sharing a name in the same root still uncheck each other, but only the group provides arrow-key navigation and a single change event with the new value.
Installation
npm install @c2n/radio
Importing @c2n/radio registers both c2-radio-group and c2-radio.
Usage
Plan
MonthlyYearly
ShippingDelivery estimates are for business days.Standard3–5 days, free over $50Express1–2 days, $9Store pickupReady in 2 hours
EnabledChecked and disabledDisabledWhole group disabledOneTwo
FreeFor personal projectsProUnlimited projects, priority supportTeamShared workspaces and SSO
Set the group’s value to select an option from code, or set checked on a radio: the group adopts it and unchecks the rest. Listen for change on the group (detail.value); the options’ own change events are stopped at the group so a listener above it hears exactly one event per selection. Every option needs a value, and an option without a checked sibling leaves the group value empty.
The inner inputs live in shadow roots, so they do not take part in a surrounding <form>; read value from the group on submit or mirror it into a hidden input. The label slot names the group for assistive technology (aria-label works too); give a standalone radio without visible text an aria-label.
The indicator is not tied to the ring. --c2-radio__control--border-radius reshapes the ring and its dot (a square control at 4px); the dot slot replaces the filled dot with a mark such as a check, drawn in --c2-radio__dot--color; and the icon and checked-icon slots replace the whole control with an icon per state, coloured by --c2-radio__icon--color and --c2-radio__icon__checked--color and sized by --c2-radio__icon--size. With only icon, the same icon shows in both states and changes colour; with only checked-icon, the ring stays for the unchecked state. Hide that ring with --c2-radio__control--border: none and move the indicator after the text with --c2-radio__container--flex-direction: row-reverse to get a menu-style check list, as in the row above.
Theme the control with --c2-radio__control--* and --c2-radio__dot--* (an accent border with a transparent fill gives the outlined look), the text with --c2-radio__label--* and --c2-radio__description--*, and the whole row with --c2-radio__container--* for card-style options. Set those variables on the group and every option inherits them, as in the Cards row above; add --c2-radio-group--align-items: stretch so the cards fill the width.
escAccordionConnected, animated panels with shared borders and single or multiple expansion.LayoutAvatarImage, initials or icon for a person, with status dot and badge.Data displayBadgeTinted pill for status text, counts and dots, optionally pinned to a corner of another element.Data displayBreadcrumbNavigation trail of link buttons with separators, a current page and optional collapsing.NavigationButtonThemeable button with slots for text, prefix, suffix and running icons.ButtonsButton GroupAttached buttons with shared borders, optionally a segmented control with single or multiple selection.ButtonsCardGroups related content and actions on a single bordered surface.LayoutChat InputAuto-growing message box with a send button for chat interfaces.ChatChat MessageOne chat bubble with avatar, title, timestamp and message body.ChatCheckboxNative checkbox behaviour in a quiet, themeable box with an opt-in hover layer.InputsCode ViewerSyntax-highlighted code with line numbers, copy button and dark mode, powered by shiki.Data displayColor AreaTwo-dimensional area for picking saturation and value of a colour.InputsColor SelectColour swatch that opens a full picker built from area and slider.InputsColor SliderHorizontal slider for choosing a hue from 0 to 360.InputsCopy ButtonButton that copies text to the clipboard — the element it sits in, another element by id, or a literal string.ButtonsDetailsCollapsible disclosure built on native details and summary.LayoutIcon ButtonRound, hoverable button wrapping a slotted SVG icon.ButtonsKbdKeyboard key label for shortcuts and command hints, with the semantics of the native kbd element.Data displayLabelCaption that names and activates the control referenced by its for attribute, with a required marker.InputsLink ButtonText-styled control for link and navigation actions, rendered as a real anchor or a button.NavigationListVertical list container with single or multiple selection.Data displayList ItemSelectable row with icon slots, used on its own or as the option of list and select.Data displayMenuCommands, links, checkboxes and submenus in a popover anchored to a trigger.NavigationModalDialog built on the native dialog element: focus trap, backdrop, Escape, title, body and footer.FeedbackNavigation MenuSite navigation bar whose triggers open panels of links below the header.NavigationOverlayAnchored popup built on the browser Popover API, positioned with floating-ui.FeedbackPaginationPage navigation in three layouts: numbered pages, a simple page status, or a table-footer row with rows-per-page.NavigationProgressLinear progress bar, indeterminate or filling to a value, with an optional label and count.FeedbackRadioRadio options built on native inputs, grouped into one value with keyboard navigation.InputsSelectDropdown that pairs a themeable trigger with an anchored list of c2-list-item options.InputsSeperatorHorizontal or vertical rule with an optional label, for dividing content and toolbars.LayoutSheetDialog pinned to an edge of the screen, for content that complements the page rather than interrupting it.FeedbackSide NavResponsive navigation drawer beside the page: pushes the content on large screens, slides over it with a backdrop on small ones.NavigationSkeletonPlaceholder block standing in for content that has not arrived, in three shapes and three animations.FeedbackSliderRange input with a themeable track, thumb, step ticks and value bubble.InputsSpinnerCircular progress indicator, indeterminate or showing a value, with optional text.FeedbackSwitchOn/off toggle on a native switch input, with label, description and thumb icons.InputsTableVirtualized data grid with declarative columns, sorting, selection, pinning and resizing.Data displayTabsTab strip that shows one content panel at a time.NavigationText FieldSingle-line input with icon slots, clear button, helper and error text, and a character counter.InputsTextareaMultiline text input with resizing, helper and error text, and a character counter.InputsToastNotification cards and a manager for stacked, queued notifications with independent lifetimes.FeedbackTooltipContextual hint shown when its target is hovered or focused, rendered in the top layer.FeedbackFeather Icons287 open-source Feather icons, one web component each.IconsMat Icon2,234 Material Icons ligatures rendered through a single element.IconsPhosphor Icons1,512 flexible icons in six weights, one web component each.IconsThemingTheme every c2n component from a handful of design tokens with @c2n/theme, or reach for any component variable directly.GuideUsing c2n in an applicationThe workflow behind every c2n app: load the theme once, use c2-* tags directly, and turn every repeated pattern into a small variant or composed component.Guide