### Setup Patternfly Documentation Core Source: https://github.com/patternfly/patternfly-doc-core/blob/main/README.mdx Installs and configures the Patternfly documentation core package in your project. This involves adding the package as a dependency, setting up scripts, creating a configuration file, and updating the Vite configuration for the development server. ```bash npx @patternfly/patternfly-doc-core@latest setup npm install yarn install npm run init:docs yarn init:docs ``` -------------------------------- ### Run Patternfly Documentation Core Source: https://github.com/patternfly/patternfly-doc-core/blob/main/README.mdx Scripts to start the development server and build the production site for the Patternfly documentation. These commands are executed from the project's root directory. ```bash npm run start npm run build:docs ``` -------------------------------- ### Astro Development Commands Source: https://github.com/patternfly/patternfly-doc-core/blob/main/README.mdx Commands for managing the development and build process of the website using Astro. This includes installing dependencies, starting the development server, building for production, previewing the build, and running Astro CLI commands. ```bash npm install npm run dev npm run build npm run preview npm run astro ... npm run astro -- --help npm run build:cli npm run build:cli:watch npm run build:props ``` -------------------------------- ### React Accordion Definition List Example Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/examples/Accordion/Accordion.mdx Demonstrates the Accordion component used as a definition list. This example likely utilizes Accordion, AccordionItem, AccordionContent, and AccordionToggle components to structure the definition list. ```typescript import AccordionDefinitionList from './AccordionDefinitionList.tsx?raw' ``` -------------------------------- ### Dropdowns for Actions and Selections with PatternFly Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md This section guides on using PatternFly's Select, Options Menu, and Dropdown components for user interactions. It provides recommendations based on use cases like single/multi-value selection, filtering, and exposing actions in limited space. ```HTML
Choice 1
Choice 2
Choice 3
``` ```JavaScript // Example JavaScript for Select Menu functionality (requires PatternFly Select component initialization) // const selectToggle = document.getElementById('select-toggle-1'); // const selectMenu = document.querySelector('.pf-c-select__menu[aria-labelledby="select-toggle-1"]'); // // Add event listeners for toggling the menu visibility and handling item selection // Example JavaScript for Options Menu functionality (requires PatternFly Options Menu component initialization) // const optionsToggle = document.getElementById('options-menu-toggle-1'); // const optionsMenu = document.querySelector('.pf-c-options-menu__menu[aria-labelledby="options-menu-toggle-1"]'); // // Add event listeners for toggling the menu visibility and handling item selection // Example JavaScript for Dropdown functionality (requires PatternFly Dropdown component initialization) // const dropdownToggle = document.getElementById('dropdown-toggle-1'); // const dropdownMenu = document.querySelector('.pf-c-dropdown__menu[aria-labelledby="dropdown-toggle-1"]'); // // Add event listeners for toggling the menu visibility and handling item selection ``` -------------------------------- ### React Accordion Toggle Icon at Start Example Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/examples/Accordion/Accordion.mdx Demonstrates the Accordion component with the toggle icon positioned at the start of the accordion header. This layout choice can affect the visual flow and alignment of the component. ```typescript import AccordionToggleIconAtStart from './AccordionToggleIconAtStart.tsx?raw' ``` -------------------------------- ### Slider Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Provides an example of the slider component for optimizing numeric data entry and visualizing input within a range. It's suitable for touch or mouse interaction. ```HTML ``` -------------------------------- ### React Accordion Bordered Style Example Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/examples/Accordion/Accordion.mdx Presents the Accordion component with a bordered style, which typically adds visual separators between items or around the entire component. This styling can enhance readability and visual structure. ```typescript import AccordionBordered from './AccordionBordered.tsx?raw' ``` -------------------------------- ### React Accordion Single Expand Behavior Example Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/examples/Accordion/Accordion.mdx Illustrates the Accordion component configured for single expand behavior, meaning only one accordion item can be expanded at a time. This is a common pattern for FAQs or detailed information sections. ```typescript import AccordionSingleExpandBehavior from './AccordionSingleExpandBehavior.tsx?raw' ``` -------------------------------- ### React Accordion Fixed Multiple Expand Behavior Example Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/examples/Accordion/Accordion.mdx Showcases the Accordion component with a fixed layout and multiple expand behavior enabled, allowing several accordion items to be expanded simultaneously. This is useful for displaying related but distinct information. ```typescript import AccordionFixedWithMultipleExpandBehavior from './AccordionFixedWithMultipleExpandBehavior.tsx?raw' ``` -------------------------------- ### Provide Contextual Help: Tooltip, Popover, Hint Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Guidance on selecting PatternFly components for contextual help. Tooltips are for short, on-demand explanations on hover. Popovers and Hints can contain richer content and are suitable for more detailed or persistent information. ```HTML

This is a hint that provides additional information.

``` -------------------------------- ### Displaying Object Details with PatternFly Components Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md This section details how to display more information about an object from a summary view. It recommends using Data List, Drawer, Table, and Popover components, explaining their suitability for different presentation formats (horizontal/vertical) and data amounts. ```HTML
Item 1
Primary content area.

Details

Detailed information panel.
Name Details
Object A
``` ```JavaScript // Example JavaScript for toggling expandable content in Data List document.querySelectorAll('[id^="expandable-toggle-"]').forEach(toggle => { toggle.addEventListener('click', () => { const contentId = toggle.getAttribute('aria-controls'); const content = document.getElementById(contentId); const isExpanded = toggle.getAttribute('aria-expanded') === 'true'; toggle.setAttribute('aria-expanded', !isExpanded); content.hidden = !content.hidden; // Update icon if applicable const icon = toggle.querySelector('i'); if (icon) { icon.classList.toggle('fa-angle-right', isExpanded); icon.classList.toggle('fa-angle-down', !isExpanded); } }); }); // Example JavaScript for toggling expandable rows in Table document.querySelectorAll('[id^="expandable-row-toggle-"]').forEach(toggle => { toggle.addEventListener('click', () => { const contentId = toggle.getAttribute('aria-controls'); const contentRow = document.getElementById(contentId); const isExpanded = toggle.getAttribute('aria-expanded') === 'true'; toggle.setAttribute('aria-expanded', !isExpanded); contentRow.hidden = !contentRow.hidden; // Update icon if applicable const icon = toggle.querySelector('i'); if (icon) { icon.classList.toggle('fa-angle-right', isExpanded); icon.classList.toggle('fa-angle-down', !isExpanded); } }); }); // Example JavaScript for Popover functionality (requires PatternFly Popover component initialization) // const popoverButton = document.getElementById('popover-button-1'); // const popoverContent = document.getElementById('popover-content-1'); // // Initialize popover using PatternFly's JS API if available // // e.g., new PfPopover(popoverButton, popoverContent); ``` -------------------------------- ### Contribute to PatternFly Core CSS Development Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/contribute.md Guidelines for contributing to the CSS development of PatternFly. This includes information on setting up the development environment and the contribution process for the core HTML/CSS library. ```CSS /* Core contribution guidelines */ /* See https://github.com/patternfly/patternfly#guidelines-for-css-development */ ``` -------------------------------- ### Progress Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Demonstrates the use of the progress component to show the percentage of completion for a task. It's recommended when the time left or percentage is known. ```HTML
75%
``` -------------------------------- ### Skeleton Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Shows the implementation of the skeleton component to indicate activity during page loading. It can be used with progress bars to provide more information about completion time. ```HTML
``` -------------------------------- ### Switch Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Shows the implementation of the switch component to indicate the state of a binary setting (e.g., on/off, enabled/disabled). It offers a larger touch target than checkboxes. ```HTML ``` -------------------------------- ### Spinner Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Illustrates the use of the spinner component to indicate activity while a user is waiting for an action to complete, especially when the time left is unknown. ```HTML
``` -------------------------------- ### Display Structured Data: Table vs. Data List Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Guidelines for choosing between PatternFly's Table and Data List components for displaying structured data. Tables are recommended for grid-like data with column headings, while Data Lists offer more flexibility for complex layouts or when rows have varying formats. ```HTML
Column 1 Column 2
Data 1.1 Data 1.2
Row Data 1
``` -------------------------------- ### Astro Content Creation with Zod Source: https://github.com/patternfly/patternfly-doc-core/blob/main/README.mdx Illustrates how Zod, a TypeScript-based schema definition library, is used within Astro for defining markdown schemas and content collections. This allows for type-safe content management. ```javascript import { defineCollection, z } from 'astro:content'; const blogCollection = defineCollection({ type: 'content', schema: z.object({ title: z.string(), pubDate: z.date(), description: z.string(), }), }); export const collections = { 'blog': blogCollection, }; ``` -------------------------------- ### Text Input Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Demonstrates the use of the text input component for single-line text entry. This component is suitable for unconstrained or context-dependent text input. ```HTML ``` -------------------------------- ### Checkbox Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Demonstrates the use of the checkbox component for selecting one or more items from a list. It can also be used to enable or disable features. ```HTML ``` -------------------------------- ### Contribute to PatternFly React Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/contribute.md Information on the contribution process for the PatternFly React library. This covers how to submit bug reports, feature requests, and general code contributions for the React components. ```JavaScript // React contribution guidelines // See https://github.com/patternfly/patternfly-react/blob/main/CONTRIBUTING.md#contribution-process ``` -------------------------------- ### Radio Button Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Illustrates the use of radio buttons for selecting from a set of mutually exclusive options. This is useful when only one choice is allowed from a group. ```HTML ``` -------------------------------- ### Number Input Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Shows the implementation of the number input component for constrained numeric data entry. This component allows users to input numbers within a specified range. ```HTML ``` -------------------------------- ### Implement Progressive Disclosure: Accordion, Expandable Section, Field Group Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Recommendations for implementing progressive disclosure in PatternFly using Accordions, Expandable Sections, and Expandable Field Groups. These components help simplify UIs by hiding and showing content as needed. ```HTML

Content for section 1.

This content is hidden by default and can be shown or hidden.

``` -------------------------------- ### Text Area Component Usage Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/usage-and-behavior.md Illustrates the use of the text area component for multi-line text entry. This component is ideal when users need to input longer text that may span multiple lines. ```HTML ``` -------------------------------- ### PatternFly Title Component - Heading Customization Source: https://github.com/patternfly/patternfly-doc-core/blob/main/textContent/typography.md Demonstrates how to customize the size of a PatternFly H2 heading using the 'size' property of the Title component. This allows for visual hierarchy adjustments while maintaining semantic correctness. ```HTML Aa ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.