@cimpress/react-components
Version:
React components to support the MCP styleguide
73 lines • 2.85 kB
JavaScript
import React from 'react';
import { CodeExample } from '@cimpress/react-components';
import SliderCode from '!raw-loader!./slider.jsx';
import SliderDemo from './slider.jsx';
import ComponentDoc from '../../shared/TabbedComponentDoc';
const SliderDocs = () => {
const propInfos = [
{
name: 'label',
type: 'string (required)',
default: '',
description: 'The label displayed above the slider',
},
{
name: 'onSelect',
type: 'function (required)',
default: '',
description: 'Once a value is selected, this callback function will receive the selected number as an argument',
},
{
name: 'value',
type: 'number (required)',
default: '',
description: 'The current value of the slider',
},
{
name: 'disabled',
type: 'boolean',
default: 'false',
description: 'Setting this to true disables the slider, and greys it out',
},
{
name: 'min',
type: 'number',
default: '0',
description: 'The minimum value that the slider can select (on the left)',
},
{
name: 'max',
type: 'number',
default: '100',
description: 'The maximum value that the slider can select (on the right)',
},
{
name: 'increment',
type: 'number',
default: '1',
description: 'Any real number denoting the increment that the slider will select',
},
{
name: 'selectOnDrag',
type: 'boolean',
default: 'false',
description: 'Setting this to true calls onSelect while dragging the slider, instead of only when it is dropped',
},
];
const remarks = (React.createElement("div", null,
React.createElement("p", null, "Sliders will expand horizontally to fill whatever container is provided."),
React.createElement("p", null,
"For examples of where sliders are used, see the",
' ',
React.createElement("a", { href: "https://caps.cimpress.io", target: "_blank", rel: "noopener noreferrer" }, "Caps Demo website"),
' ',
"or the",
' ',
React.createElement("a", { href: "https://apis.documents.cimpress.io", target: "_blank", rel: "noopener noreferrer" }, "Documents APIs webpage"),
".")));
return (React.createElement(ComponentDoc, { name: "Slider", propInfos: propInfos, remarks: remarks },
React.createElement(SliderDemo, null),
React.createElement(CodeExample, { code: SliderCode })));
};
export default SliderDocs;
//# sourceMappingURL=index.js.map