Demos
Dropdown variant (default)
Empty
<Field.Selection onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Placeholder
<Field.Selectionplaceholder="Select something...."onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Label
<Field.Selectionlabel="Label text"onChange={(value) => console.log('onChange', value)}/>
Option selected
<Field.Selectionvalue="bar"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Label and option selected
<Field.Selectionvalue="bar"label="Label text"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Horizontal layout
<Field.Selectionvalue="bar"label="Label text"layout="horizontal"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Widths
<Field.Selectionlabel="Default width (property omitted)"value="bar"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection><Field.Selectionlabel="Medium"value="bar"width="medium"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection><Field.Selectionlabel="Large"value="bar"width="large"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection><Field.Selectionlabel="Stretch"value="bar"width="stretch"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Disabled
<Field.Selectionvalue="bar"label="Label text"onChange={(value) => console.log('onChange', value)}disabled><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Error
<Field.Selectionvalue="bar"label="Label text"onChange={(value) => console.log('onChange', value)}error={new FormError('This is what is wrong...')}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
High number of options
<Field.Selectionvalue="option-15"label="Label text"onChange={(value) => console.log('onChange', value)}><Field.Option value="option-1" title="One" /><Field.Option value="option-2" title="Two" /><Field.Option value="option-3" title="Three" /><Field.Option value="option-4" title="Four" /><Field.Option value="option-5" title="Five" /><Field.Option value="option-6" title="Six" /><Field.Option value="option-7" title="Seven" /><Field.Option value="option-8" title="Eight" /><Field.Option value="option-9" title="Nine" /><Field.Option value="option-10" title="Ten" /><Field.Option value="option-11" title="Eleven" /><Field.Option value="option-12" title="Twelve" /><Field.Option value="option-13" title="Thirteen" /><Field.Option value="option-14" title="Fourteen" /><Field.Option value="option-15" title="Fifteen" /><Field.Option value="option-16" title="Sixteen" /><Field.Option value="option-17" title="Seventeen" /><Field.Option value="option-18" title="Eighteen" /><Field.Option value="option-19" title="Nineteen" /><Field.Option value="option-20" title="Twenty" /><Field.Option value="option-21" title="Twentyone" /><Field.Option value="option-22" title="Twentytwo" /><Field.Option value="option-23" title="Twentythree" /><Field.Option value="option-24" title="Twentyfour" /><Field.Option value="option-25" title="Twentyfive" /></Field.Selection>
Validation - Required
<Field.Selectionlabel="Label text"onChange={(value) => console.log('onChange', value)}requiredvalidateInitiallyvalidateUnchanged><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Radio variant
Empty
<Field.Selectionvariant="radio"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Label
<Field.Selectionvariant="radio"label="Label text"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Option selected
<Field.Selectionvariant="radio"value="bar"onChange={(value) => console.log('onChange', value)}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Disabled
<Field.Selectionvariant="radio"value="bar"label="Label text"onChange={(value) => console.log('onChange', value)}disabled><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>
Error
<Field.Selectionvariant="radio"value="bar"label="Label text"onChange={(value) => console.log('onChange', value)}error={new FormError('This is what is wrong...')}><Field.Option value="foo" title="Foo!" /><Field.Option value="bar" title="Baar!" /></Field.Selection>