Sha256: ede7d606a8fa90a4a2913fcec9f56b6a4bf541b8e8ce2d44000af28c2ae1597c

Contents?: true

Size: 817 Bytes

Versions: 948

Compression:

Stored size: 817 Bytes

Contents

import React, { useState } from 'react'
import { Dropdown } from 'playbook-ui'

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

948 entries across 948 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx