### Development Quick Start Commands
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/README.md
Commands to clone the repository, install dependencies, and build/launch Storybook for local development.
```sh
# Clone the project
git clone git@gitlab.com:gitlab-org/gitlab-services/design.gitlab.com.git
# Navigate to the root of the project
cd design.gitlab.com/packages/gitlab-ui
# Install all the dependencies of the project
yarn # or yarn install
# Build and launch storybook to see the components in the browser
yarn storybook
```
--------------------------------
### Install Dependencies and Start Development Server
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/README.md
Install project dependencies using Yarn and start the development server for live building and watching changes.
```bash
yarn install
yarn start
```
--------------------------------
### Registering Component for Examples
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/doc/component-examples.md
This Markdown frontmatter example shows how to register a Vue component, such as `GlBroadcastMessage`, to enable its examples to load in the documentation's **Implementation** tab. This step is mandatory for examples to be displayed.
```markdown
---
name: Broadcast message
vueComponents:
- GlBroadcastMessage
---
```
--------------------------------
### Example of a valid release notes description line
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/get-started/uik-contributing.md
Use this format to add a single line describing a change. Start with an action verb.
```markdown
- Adds multiple-choice icon
```
--------------------------------
### Start Development Server with Yarn
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/tailwind-documentation/README.md
Run this command to start the development server.
```sh
yarn dev
```
--------------------------------
### GlPopover Documentation Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/popover.md
This story viewer is used to display documentation and examples for the GlPopover component in docs view mode.
```html
```
--------------------------------
### Start Local Development Server
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-svgs/README.md
Execute this command to start a local server for previewing SVG changes. The preview will be available at http://localhost:3333/.
```bash
# Starts a local server to preview your changes
yarn run dev
```
--------------------------------
### Basic GlIntersperse Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/utility-intersperse.md
A basic example demonstrating the GlIntersperse component with multiple child elements.
```html
FooBarBazQaz
```
--------------------------------
### Start Local Development Server
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-svgs/README.md
Execute this command to start a local server for previewing your SVG changes at http://localhost:3333/.
```bash
yarn run dev
```
--------------------------------
### GlFormGroup Documentation Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/form-group.md
This is a documentation example of the GlFormGroup component.
```html
```
--------------------------------
### Embedding Component Examples in Docs
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/doc/component-examples.md
This is an example of how to use the `` component in Markdown to embed a specific component example into a documentation page. Replace `` with the actual ID defined in the `index.js` file.
```html
```
--------------------------------
### GlFormGroup Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/form-group.md
This is an example of how to use the GlFormGroup component.
```html
```
--------------------------------
### Start Storybook for Development
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/doc/contributing/accessibility_testing.md
Run this command to start Storybook locally for immediate feedback on accessibility violations during development.
```shell
yarn storybook
```
--------------------------------
### Install Dependencies with Yarn
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/tailwind-documentation/README.md
Use this command to install project dependencies.
```sh
yarn install
```
--------------------------------
### Basic b-tooltip Usage Examples
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/tooltip/README.md
Demonstrates how to use the b-tooltip component with different methods of targeting elements and providing content. Includes examples for text titles and HTML content.
```html
Live chatHtml chatAlternative chat
Hello World!
```
--------------------------------
### GlSorting Implementation Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/sorting.md
A complete example demonstrating how to implement the GlSorting component. It includes setting up sort options, handling sortBy and sortDirectionChange events, and a placeholder for the actual data sorting logic.
```html
```
--------------------------------
### Registering Component Examples
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/doc/component-examples.md
This JavaScript code demonstrates how to import and register Vue component examples in an index.js file. It organizes examples into named groups with unique IDs and names, linking them to their respective component files.
```javascript
import MyComponentDefaultExample from './my_component.default.example.vue';
export default [
{
// The example group's name, you can add more groups to better organize examples
name: 'Basic',
items: [
{
// Give your example an ID. Keep this unique across all examples
id: 'my-component-default',
// The name will appear in the examples selector in the Implementation tab
name: 'Default',
// The example component as imported at the top
component: MyComponentDefaultExample,
},
],
},
];
```
--------------------------------
### Basic Attribute List Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/attribute-list.md
This example demonstrates a basic attribute list with several items, each featuring an icon, label, and text value. It's suitable for displaying read-only metadata.
```html
```
--------------------------------
### Complete BootstrapVue Table Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md
This example showcases a fully functional table with sorting, filtering, pagination, and custom row details. It includes UI controls for managing these features.
```html
ClearNameAgeActive
{{ row.value.first }} {{ row.value.last }}
Info modal
{{ row.detailsShowing ? 'Hide' : 'Show' }} Details
{{ key }}: {{ value }}
```
--------------------------------
### GlTable Implementation Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/table.md
Example demonstrating how to use the GlTable component with custom fields and slots for header and cell content. Ensure fields are passed as an array of objects for internationalization.
```html
First column
This is the template for column data belonging to the first object
```
--------------------------------
### Example Major Version Bump Changeset
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/doc/changesets.md
This changeset example demonstrates a major version bump, including a description of breaking changes and guidance for users on how to adapt.
```markdown
---
'@gitlab/ui': major
---
GlFoo: Removed component.
Use the GlBar component instead.
```
--------------------------------
### Example of an invalid release notes description line
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/get-started/uik-contributing.md
Avoid informal language and ensure descriptions start with an action verb.
```markdown
- Hey can you take a look at this? I added a new icon
```
--------------------------------
### Start Full Development Mode
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/README.md
Starts the documentation site and GitLab UI's Storybook. Automatically links the documentation site to use your local Storybook instance for live component stories. Useful for developing GitLab UI components.
```bash
yarn start:full
```
--------------------------------
### Example of a multi-line release notes description
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/get-started/uik-contributing.md
Provide additional details after the first line. Subsequent lines do not need to start with action verbs.
```markdown
- Removes header property from Modal
- Header property is not optional in GitLab UI
- Updates instances to have realistic content
```
--------------------------------
### GlMultiStepFormTemplate Usage Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/form-multi-step.md
Demonstrates how to use the GlMultiStepFormTemplate component, typically wrapped in a form element. This setup places submit and cancel buttons outside the template for standard form behavior.
```html
```
--------------------------------
### b-table-simple with Stacked Mode
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md
Example of a b-table-simple configured for stacked mode, demonstrating the use of the 'stacked-heading' prop on table cells to generate headings for stacked views. This setup is crucial for accessibility and proper display on smaller screens.
```html
Items sold in August, grouped by Country and City:
RegionClothesAccessoriesCountryCityTrousersSkirtsDressesBraceletsRingsBelgium (3 Cities)Antwerp5622437223Gent4618506115Brussels5127386928The Netherlands (2 Cities)Amsterdam8934698538Utrecht8012433619
Total Rows: 5
```
--------------------------------
### BootstrapVue msgBoxOk Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/modal/README.md
Demonstrates how to trigger a simple OK message box and one with custom options. The return value indicates user interaction.
```html
msgBoxOk with options
Return value: {{ String(boxTwo) }}
```
--------------------------------
### Listening to Dropdown Show Event
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/dropdown/README.md
Example of how to listen for dropdown opening events globally using `$root.$on`. This allows you to react when any dropdown is about to be shown.
```javascript
export default {
mounted() {
this.$root.$on('bv::dropdown::show', bvEvent => {
console.log('Dropdown is about to be shown', bvEvent)
})
}
}
```
--------------------------------
### Basic Form Example with BootstrapVue
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/form/README.md
Demonstrates a complete form structure using b-form, b-form-group, b-form-input, b-form-select, b-form-checkbox-group, and b-button. Includes submission and reset handlers.
```html
Check me outCheck that outSubmitReset
{{ form }}
```
--------------------------------
### Basic GlFormSelect Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/select.md
A basic example of the GlFormSelect component with a default empty option.
```html
```
--------------------------------
### Listening to Tooltip Show Event
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/tooltip/README.md
Sets up a listener on the `$root` instance for the `bv::tooltip::show` event. This allows you to react when any tooltip is shown, receiving event details.
```javascript
export default {
mounted() {
this.$root.$on('bv::tooltip::show', bvEvent => {
console.log('bvEvent:', bvEvent)
})
}
}
```
--------------------------------
### Generate Static Output
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-svgs/README.md
Use this command to generate the static output for the preview application, which will be placed in the `public` folder.
```bash
yarn run generate
```
--------------------------------
### Basic GlLabel Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/label.md
A basic example of the GlLabel component with a background color, title, and target URL.
```html
```
--------------------------------
### Basic Popover Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/popover.md
This is a basic example of a popover component. It is typically triggered by a click event on an associated element.
```html
```
--------------------------------
### Live Example: Custom Toggle with Avatar
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/dropdown-combobox.md
A live example of GlCollapsibleListbox using a custom toggle. The toggle displays an avatar and uses accessibility attributes, including a bound ID for screen reader text. This example requires Vue.js and the GlAvatar component.
```html
```
--------------------------------
### Basic Table Styles Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md
Demonstrates how to dynamically control various table styling options using checkboxes and radio buttons. This example allows users to toggle features like striped rows, borders, hover effects, and header variants.
```html
StripedBorderedBorderlessOutlinedSmallHoverDarkFixedFoot CloneNo border collapseNoneLightDark
```
--------------------------------
### Simple Table with Sticky Columns
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md
Demonstrates how to create a simple table with sticky columns using `` and the `sticky-column` prop on individual cells. Ensure the `responsive` prop is set for proper behavior.
```html
Sticky Column HeaderHeading 1Heading 2Heading 3Heading 4Sticky Column Row HeaderCellCellCellCellSticky Column Row HeaderCellCellCellCellSticky Column FooterHeading 1Heading 2Heading 3Heading 4
```
--------------------------------
### Default Card Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/card.md
A basic example of a GlCard component with custom header, default slot content, and custom footer.
```html
This is a custom header
Hello World
This is a custom footer
```
--------------------------------
### Popover with Close Button Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/contents/components/popover.md
This example demonstrates a popover that includes a close button for explicit dismissal. It is configured to open on click.
```html
```
--------------------------------
### BootstrapVue msgBoxConfirm Example
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/modal/README.md
Shows how to use msgBoxConfirm for user confirmation, both with default settings and custom options. The promise resolves with a boolean indicating the user's choice.
```html
msgBoxConfirm with options
Return value: {{ String(boxTwo) }}
```
--------------------------------
### Install GitLab UI Package
Source: https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/main/packages/gitlab-ui/README.md
Add GitLab UI as a dependency to your project using Yarn. Ensure peer dependencies are also installed.
```sh
yarn add @gitlab/ui
```