diff --git a/packages/clay-core/docs/picker.js b/packages/clay-core/docs/picker.js
index c8a4e7bb69..875ab23f22 100644
--- a/packages/clay-core/docs/picker.js
+++ b/packages/clay-core/docs/picker.js
@@ -4,8 +4,13 @@
*/
import Editor from '$clayui.com/src/components/Editor';
-import {Option, Picker} from '@clayui/core';
+import {Option, Picker, Text} from '@clayui/core';
+import DropDown from '@clayui/drop-down';
import Form from '@clayui/form';
+import Icon from '@clayui/icon';
+import Label from '@clayui/label';
+import Layout from '@clayui/layout';
+import {useId} from '@clayui/shared';
import React from 'react';
const exampleImports = `import {Option, Picker} from '@clayui/core';
@@ -53,4 +58,212 @@ const PickerExample = () => {
return ;
};
-export {PickerExample};
+const exampleTriggerImports = `import {Option, Picker} from '@clayui/core';
+import Form from '@clayui/form';
+import Icon from '@clayui/icon';
+import React from 'react';`;
+
+const exampleTriggerCode = `const Trigger = React.forwardRef(({children, ...otherProps}, ref) => (
+
+
+ {children}
+
+));
+
+const CustomTrigger = () => {
+ const pickerId = useId();
+ const labelId = useId();
+
+ return (
+
+
+
+ Choose a user
+
+
+ {(item) => {item} }
+
+
+
+ );
+};
+
+render( )`;
+
+const PickerTriggerExample = () => {
+ const scope = {Form, Icon, Option, Picker, React, useId};
+
+ return (
+
+ );
+};
+
+const exampleOptionsImports = `import {Option, Picker} from '@clayui/core';
+import Form from '@clayui/form';
+import React from 'react';`;
+
+const exampleOptionsCode = `const CustomOptions = () => {
+ const pickerId = useId();
+ const labelId = useId();
+
+ return (
+
+
+
+ Choose a user
+
+
+ {(item) => (
+
+
+
+
+ {item}
+
+
+ Description
+
+
+
+
+ Active
+
+
+
+
+ )}
+
+
+
+ );
+};
+
+render( )`;
+
+const PickerOptionsxample = () => {
+ const scope = {
+ Form,
+ Icon,
+ Label,
+ Layout,
+ Option,
+ Picker,
+ React,
+ Text,
+ useId,
+ };
+
+ return (
+
+ );
+};
+
+const exampleGroupImports = `import {Option, Picker} from '@clayui/core';
+import Form from '@clayui/form';
+import Icon from '@clayui/icon';
+import React from 'react';`;
+
+const exampleGroupCode = `const Trigger = React.forwardRef(({children, ...otherProps}, ref) => (
+
+
+ {children}
+
+));
+
+const CustomTrigger = () => {
+ const pickerId = useId();
+ const labelId = useId();
+
+ return (
+
+
+
+ Select an option
+
+
+ {(group) => (
+
+ {(item) => (
+ {item.label}
+ )}
+
+ )}
+
+
+
+ );
+};
+
+render( )`;
+
+const PickerGroupExample = () => {
+ const scope = {DropDown, Form, Option, Picker, React, useId};
+
+ return (
+
+ );
+};
+export {
+ PickerExample,
+ PickerGroupExample,
+ PickerTriggerExample,
+ PickerOptionsxample,
+};
diff --git a/packages/clay-core/docs/picker.mdx b/packages/clay-core/docs/picker.mdx
index 94d3030990..ca7350b096 100644
--- a/packages/clay-core/docs/picker.mdx
+++ b/packages/clay-core/docs/picker.mdx
@@ -6,7 +6,12 @@ packageStatus: 'Beta'
storybookPath: 'design-system-components-picker'
---
-import {PickerExample} from '$packages/clay-core/docs/picker';
+import {
+ PickerExample,
+ PickerGroupExample,
+ PickerTriggerExample,
+ PickerOptionsxample,
+} from '$packages/clay-core/docs/picker';
@@ -17,6 +22,10 @@ import {PickerExample} from '$packages/clay-core/docs/picker';
- [Static](#static)
- [Dynamic](#dynamic)
- [Controlled and Uncontrolled component](#controlled-and-uncontrolled-component)
+- [Composition](#composition)
+ - [Custom Trigger](#custom-trigger)
+ - [Custom Options](#custom-options)
+ - [Group](#group)
- [Hybrid component](#hybrid-component)
@@ -128,6 +137,22 @@ function Example() {
}
```
+## Composition
+
+The composition allows you to customize the component or add new features. See some examples:
+
+### Custom Trigger
+
+
+
+### Custom Options
+
+
+
+### Group
+
+
+
## Hybrid component
Native select for mobile devices offers a better experience compared to Picker in some cases. The Picker offers the possibility to render using the native selector of the browser of the device when it is detected that it is on a mobile device, by default this property is disabled but it can be enabled by setting the `native` property to `true`.