Sleek Form

Sleek Form

  • Docs

›Components

Components

  • Text
  • Rating
  • Scale
  • Select
  • Question
  • Summary
  • Welcome
  • Radio
  • SleekFormThemProvider

Select

Select component to select value from options.

Usage

const options: Array<OptionType> = [
  {
    label: 'India',
    value: 'India',
  },
  {
    label: 'China',
    value: 'China',
  },
  {
    label: 'Cuba',
    value: 'Cuba',
  },
];

<SleekSelect
  options={options}
  placeholder="Select a Country"
  defaultValue={options[0]}
  onChange={(value: OptionType) => console.log(value.value)}
/>

Types

export type OptionType = { label: string; value: string };

Props

The SelectField supports the following properties

PropsDescriptionTypeDefault
onChange?onChange callback(value: OptionType) => void;None
placeholder?Placeholder of select.stringNone
value?Current selected rating.OptionTypeNone
defaultValue?Initial selected rating.OptionTypeNone
name?Name of the HTML Input (optional - without this, no input will be rendered)stringNone
optionsarray of values of the scaleArrayNone

Demo

You can view a live demo of SelectField in our sandbox

← ScaleQuestion →
  • Usage
  • Types
  • Props
  • Demo
Sleek Form
Docs
Getting Started
More
GitHub
Copyright © 2020 Fresalabs