Skip to content

✨ feat: add tag, content and hideIndicator to RadioCard - #723

Open
futjesus wants to merge 1 commit into
mainfrom
feat/radio-card-content
Open

futjesus wants to merge 1 commit into
mainfrom
feat/radio-card-content

Conversation

@futjesus

@futjesus futjesus commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Compute built a ToggleGroup from scratch to get a selectable card with a badge next to the label and an interactive panel inside the selected option; databases forced a "title + description, no visible radio" card out of RadioCard with four ! overrides and className="hidden".

  • tag: renders a Badge next to the label.
  • hideIndicator: hides the radio circle so the card border carries the selection.
  • content: rendered below the label, outside the <label>, so its controls (a Select, inputs) are usable without toggling the radio. As a function it receives the checked state.

Type fix: Props no longer inherits content and onChange from the Card's HTML attributes. onChange was typed as a div change handler intersected with the radio callback, which is why databases had to narrow with typeof value === 'string'.

RadioCardGroup options pick up the new props automatically.

Test plan

  • New tests: tag, hidden indicator, interactive content with checked state (clicking inside does not toggle), static content, axe
  • npx vitest run lib/components/RadioCard lib/components/RadioCardGroup (17), lint, types, prettier
  • Storybook: RadioCardWithTagAndContent

Compute built a ToggleGroup from scratch to get a selectable card with a
badge next to the label and an interactive panel inside the selected
option; databases forced a "title + description, no visible radio" card
out of RadioCard with four `!` overrides and `className="hidden"`.

`tag` renders a Badge next to the label, `hideIndicator` hides the radio
circle so the card border carries the selection, and `content` renders
below the label outside the `<label>`, so its controls are usable without
toggling the radio; as a function it receives the checked state.

Props no longer inherit `content` and `onChange` from the Card's HTML
attributes: `onChange` was typed as a div change handler intersected with
the radio callback, which forced consumers to narrow the argument.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant