Sha256: b05586f8939523aa855b5a6ff04970d64e9886dd987d555430c5362708994e68

Contents?: true

Size: 812 Bytes

Versions: 60

Compression:

Stored size: 812 Bytes

Contents

import React, { useState } from 'react'
import { Dropdown } from '../../'

const DropdownError = (props) => {
    const [selectedOption, setSelectedOption] = useState()
    const error = selectedOption?.value ? null : "Please make a valid selection"
    const options = [
        {
            label: "United States",
            value: "United States",
        },
        {
            label: "Canada",
            value: "Canada",
        },
        {
            label: "Pakistan",
            value: "Pakistan",
        }
    ]

    return (
        <>
            <Dropdown
                error={error}
                onSelect={(selectedItem) => setSelectedOption(selectedItem)}
                options={options}
                {...props}
            />
        </>
    )
}

export default DropdownError

Version data entries

60 entries across 60 versions & 2 rubygems

Version Path
playbook_ui-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.33.0.pre.alpha.PLAY1454formpillicons3309 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.33.0.pre.alpha.PLAY1454formpillicons3309 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.33.0 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.32.0.pre.alpha.PBNTR405dropdownformfixesrails3301 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.32.0.pre.alpha.PBNTR405dropdownformfixesrails3301 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.32.0.pre.alpha.PLAY1138iconkitaddcolorprop3268 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.32.0.pre.alpha.PLAY1138iconkitaddcolorprop3268 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.32.0.pre.alpha.play1416movealiaslogic3266 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3266 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.32.0.pre.alpha.play1416movealiaslogic3239 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3239 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.32.0.pre.alpha.PLAY14103236 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.32.0.pre.alpha.PLAY14103236 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.31.0.pre.alpha.play1416movealiaslogic3232 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.31.0.pre.alpha.play1416movealiaslogic3232 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.31.0.pre.alpha.PBNTR342navtabbing3231 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.31.0.pre.alpha.PBNTR342navtabbing3231 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-13.31.0.pre.alpha.PBNTR342navtabbing3230 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-13.31.0.pre.alpha.PBNTR342navtabbing3230 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx