Next.js Discord

Discord Forum

Best way to structure a complex (nested) shadcn select component?

Unanswered
Tonkinese posted this in #help-forum
Open in Discord
TonkineseOP
I'm trying to build a form using shadcn that has two components, 1. a select input (input A) with values ["foo", "bar"] (last example on https://ui.shadcn.com/docs/components/select), and 2. A list of checkboxes (input B) (last example on https://ui.shadcn.com/docs/components/checkbox).

input B should render content based on the value in selected in input A.

What's the best way of structuring the parent "Filter" component in both a modular way (i.e. so that new inputs (C, D, etc) can be added) and also so that whenever a change is made in input A, it re-renders the contents of input B

0 Replies