Patterns

By creating pattern-specific pages, you can centralize and document your design system components, making it easier to maintain consistency and share them with your team.

View as Markdown

Adding a new Pattern

Creating a new pattern in your Knapsack workspace is straightforward. This section walks you through the simple steps required to add a new pattern:

  1. Navigate to the primary or a secondary navigation menu.
  2. Click on the “Add New” button and choose “Pattern”.
  3. Enter the title for your new pattern and configure any initial settings.
  4. Click “Add Pattern” to add the new page to your documentation.

Screenshot 2024-08-05 at 1.43.34 PM.png


Connecting Code Sources

Connect to New Pattern

Navigate to the Patterns section through the main app bar and click the New Pattern button in the top right to open the Add New Pattern modal.

  1. Give your pattern a title (must be unique)
  2. Choose the documentation location. By default, we’ll attempt to put the documentation under an existing group/page titled Components or Patterns.
  3. Expand the Connect Template section to choose a template from packages you’ve already connected. If the template you want to connect is not available, you can add it later through the Template Panel.
  4. Click Add Pattern

Connect to Existing Pattern

Navigate to the Patterns section through the main app bar and find the pattern you want to add a template to.