### PageHeader Theming Example (size.small.pad) Source: https://v2.grommet.io/pageheader Example of theme customization for padding when PageHeader size is 'small'. ```json { "pageHeader": { "size": { "small": { "pad": { "top": "medium", "bottom": "small" } } } } } ``` -------------------------------- ### PageHeader Theming Example (pad) Source: https://v2.grommet.io/pageheader Example of theme customization for the PageHeader padding, using a string value for consistent padding. ```json { "pageHeader": { "pad": "large" } } ``` -------------------------------- ### PageHeader Theming Example (size.small.title) Source: https://v2.grommet.io/pageheader Example of theme customization for the title when PageHeader size is 'small', applying Heading props. ```json { "pageHeader": { "size": { "small": { "title": { "size": "small" } } } } } ``` -------------------------------- ### PageHeader Theming Example (size.medium.pad) Source: https://v2.grommet.io/pageheader Example of theme customization for padding when PageHeader size is 'medium'. Defaults to global 'pageHeader.pad' if not specified. ```json { "pageHeader": { "size": { "medium": { "pad": {} } } } } ``` -------------------------------- ### SelectMultiple Basic Usage Example Source: https://v2.grommet.io/selectmultiple A basic example demonstrating how to use the SelectMultiple component. It shows how to provide placeholder text and an array of options for selection. ```jsx function Example() { return ( ); } ``` -------------------------------- ### SelectMultiple Prop: help String Example Source: https://v2.grommet.io/selectmultiple An example of the help prop using a string, providing simple help text above the options in the drop-down. ```javascript help text ``` -------------------------------- ### Basic Menu Example Source: https://v2.grommet.io/menu A simple example demonstrating how to use the Menu component with basic items. It shows the structure for defining menu items with labels and click handlers. ```javascript import { Menu } from 'grommet'; {} }, { label: 'Second Action', onClick: () => {} }, ]} /> ``` -------------------------------- ### PageHeader Theming Example (actions) Source: https://v2.grommet.io/pageheader Example of theme customization for the PageHeader's actions container, applying Box props to control alignment. ```json { "pageHeader": { "actions": { "align": "end" } } } ``` -------------------------------- ### SelectMultiple Prop: help Node Example Source: https://v2.grommet.io/selectmultiple An example of the help prop using a React node, allowing for more complex help text content above the options. ```jsx help text ``` -------------------------------- ### PageHeader Theming Example (title) Source: https://v2.grommet.io/pageheader Example of theme customization for the PageHeader's title, applying Heading props to control fill and margin. ```json { "pageHeader": { "title": { "fill": true, "margin": "none" } } } ``` -------------------------------- ### Grommet Header Component Example Source: https://v2.grommet.io/header Example of how to use the Grommet Header component with a background, an icon button, and a menu. This component acts as a container for introductory content and can be customized using Box properties. ```javascript
``` -------------------------------- ### PageHeader Theming Example (size.small.subtitle) Source: https://v2.grommet.io/pageheader Example of theme customization for the subtitle when PageHeader size is 'small', applying Paragraph props. ```json { "pageHeader": { "size": { "small": { "subtitle": { "size": "small" } } } } } ``` -------------------------------- ### Chart Component Example - Grommet JS Source: https://v2.grommet.io/chart This example demonstrates the basic usage of the Grommet Chart component in JavaScript. It defines bounds and values to render a chart, with labels for data points. This is a foundational example for visualizing data within the Grommet framework. ```javascript import { Chart } from 'grommet'; ; ``` -------------------------------- ### PageHeader Theming Example (size.medium.subtitle) Source: https://v2.grommet.io/pageheader Example of theme customization for the subtitle when PageHeader size is 'medium'. Defaults to global 'pageHeader.subtitle' if not specified. ```json { "pageHeader": { "size": { "medium": { "subtitle": {} } } } } ``` -------------------------------- ### Grommet DataFilters Usage Example Source: https://v2.grommet.io/datafilters An example demonstrating how to use the DataFilters component within a Grommet application, integrating it with Data, Toolbar, and DataTable components. This setup allows for interactive filtering of data displayed in a table. ```javascript ``` -------------------------------- ### PageHeader Theming Example (parent) Source: https://v2.grommet.io/pageheader Example of theme customization for the PageHeader's parent container, applying Box props to control alignment. ```json { "pageHeader": { "parent": { "align": "start" } } } ``` -------------------------------- ### Grommet Diagram Theme Configuration Examples (Object) Source: https://v2.grommet.io/diagram Shows how to configure the 'diagram.animation', 'diagram.line.color', and 'global.colors' properties within the Grommet theme object. These examples demonstrate setting durations for animations and defining color schemes. ```javascript const theme = { diagram: { animation: { pulse: { duration: 1000, }, draw: { duration: 2000, }, }, line: { color: "graph-0", }, }, global: { colors: { "graph-0": "#6FFFB0", "graph-1": "#00873D", // ... other color definitions }, }, }; ``` -------------------------------- ### Grommet Calendar Props Examples Source: https://v2.grommet.io/calendar This section showcases various ways to configure the Grommet Calendar component using its extensive props. Examples include setting date ranges, disabling specific dates, customizing the header, and internationalizing messages. These examples illustrate the flexibility and power of the Calendar component. ```javascript // Example for 'bounds' prop ``` ```javascript // Example for 'disabled' prop with a date range ``` ```javascript // Example for 'header' prop custom rendering ( <> {date.toLocaleDateString(locale, { month: 'long', year: 'numeric' }) } )}/> ``` ```javascript // Example for 'messages' prop customization ``` ```javascript // Example for 'date' prop with a single date ``` ```javascript // Example for 'dates' prop with multiple selected dates ``` ```javascript // Example for 'dates' prop with a range of dates ``` ```javascript // Example for 'firstDayOfWeek' prop set to Monday ``` ```javascript // Example for 'children' prop to customize day rendering {({ date, day, isInRange, isSelected }) => (
{day}
)}
``` -------------------------------- ### Grommet Diagram Component Example (React) Source: https://v2.grommet.io/diagram An example of how to use the Grommet Diagram component in a React application. It demonstrates setting up connections with specified 'fromTarget', 'toTarget', 'thickness', and 'color'. ```jsx import React from 'react'; import { Stack, Diagram } from 'grommet'; const App = () => ( ); export default App; ``` -------------------------------- ### Video Component Theming Examples Source: https://v2.grommet.io/video Demonstrates how to customize the appearance and behavior of the Video component through Grommet's theming system. Examples include setting caption background, icon replacements, scrubber color, and custom CSS styles. ```javascript const customTheme = { global: { edgeSize: { responsiveBreakpoint: 'small', xsmall: '6px' } }, video: { captions: { background: 'rgba(0, 0, 0, 0.7)' }, icons: { closedCaption: , configure: , fullScreen: , pause: , play: , reduceVolume: , volume: }, scrubber: { color: 'light-4' } } }; // Usage with ThemeProvider // Example of extend with CSS