Replicating form view single select UI component in an app

I am making a data entry app that is similar to an Airtable Form View. For a certain field, I am looking for my users to choose a single item from a drop-down menu of available options. I am wondering if there is a way to replicate the select style used in the Airtable form views:

I see the ChoiceToken React component and the Select React component in the Apps API reference, but I’m not sure how to populate the Select component with ChoiceTokens. My attempt led me to a Select component populated with blank options.

  const base = useBase();
  const newEntryTable = base.getTableByName("Example Table");
  const field = newEntryTable.getFieldByName("Choose One");

  function SelectExample() {
	  const [value, setValue] = useState(options[0].value);
	  return (
	      options={ => (
	        <ChoiceToken key={} choice={choice} marginRight={1} />
	      onChange={newValue => setValue(newValue)}

Resulting Select component:

The select component can’t handle react subcomponents as arguments.

Use an external library to have fancy dropdowns. My apps use PrimeReact’s Dropdown or Multiselect components.

1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.