---
url: 'https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/single-directory-components'
title: 'Single Directory Components | DXPR'
author:
  name: Jurriaan
  url: 'https://dxpr.com/users/jurriaan'
date: '2026-10-26T18:01:04+00:00'
copyright: 'Copyright DXPR. All rights reserved.'
type: article
summary: 'Single Directory Components (SDC) is the Drupal core API, stable since Drupal 10.3, for reusable UI components with typed props and slots.'
tags:
  - 'Drupal glossary'
image: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
published: true
og:
  site_name: DXPR
  updated_time: '2026-10-26T18:01:04+0000'
  'image:alt': 'DXPR, powered by Drupal: AI-powered Drupal for marketers.'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      '@type': FAQPage
      mainEntity:
        -
          '@type': Question
          name: 'Do I need to enable a module to use Single Directory Components?'
          acceptedAnswer:
            '@type': Answer
            text: '<p>No. SDC has been part of core&#039;s theming system since Drupal 10.3, and the project page says you do not need the contributed module. In Drupal 11.4.10 the old Single-Directory Components module is a hidden, obsolete stub; the change record says it can be uninstalled.</p>'
        -
          '@type': Question
          name: 'What is the difference between a prop and a slot?'
          acceptedAnswer:
            '@type': Answer
            text: '<p>A prop is a named input with a type that you describe in JSON Schema, such as a string limited to a list of values. A slot is a named area that holds markup you pass in, such as the body of a notice. In the Twig file, a prop is a variable and a slot is a block.</p>'
        -
          '@type': Question
          name: 'Can a module provide components as well as a theme?'
          acceptedAnswer:
            '@type': Answer
            text: '<p>Yes. The plugin manager scans the components folder of every installed module and theme. One difference matters: a module&#039;s components must have a schema, while a theme&#039;s components need one only if the theme&#039;s info file sets enforce_prop_schemas to true.</p>'
        -
          '@type': Question
          name: 'How does Drupal Canvas use Single Directory Components?'
          acceptedAnswer:
            '@type': Answer
            text: '<p>Canvas lists SDCs as one of its component types. Its 1.12.0 documentation lists the rules a component must meet, among them a props schema (even in a theme), a title on every prop and slot, an example for each required prop, and no obsolete status or noUi: true flag.</p>'
    -
      '@type': TechArticle
      headline: 'Single Directory Components'
      description: 'Single Directory Components (SDC) is the Drupal core API, stable since Drupal 10.3, for reusable UI components with typed props and slots.'
      image:
        '@type': ImageObject
        url: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
        width: '1200'
        height: '630'
      datePublished: '2026-10-26T18:01:04+0000'
      dateModified: '2026-10-26T18:01:04+0000'
      author:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      mainEntityOfPage: 'https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/single-directory-components'
      articleSection: 'Drupal glossary'
    -
      '@type': WebPage
      '@id': 'https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/single-directory-components'
      description: 'Single Directory Components (SDC) is the Drupal core API, stable since Drupal 10.3, for reusable UI components with typed props and slots.'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://dxpr.com/'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
      inLanguage: en
---
[Help Center](/hc)/[Documentation](/hc/documentation) /[Learn Drupal](/hc/documentation/learn-drupal) /[Drupal glossary](/hc/documentation/learn-drupal/drupal-glossary) # Single Directory Components

Single Directory Components (SDC) is the Drupal core API, stable since Drupal 10.3, for reusable UI components with typed props and slots.

 Learn DrupalDrupal glossary Last updated October 26, 2026

   ## In this guide

 Related terms

- [Twig](/hc/documentation/learn-drupal/drupal-glossary/twig)
- [Theme](/hc/documentation/learn-drupal/drupal-glossary/theme)
- [Module](/hc/documentation/learn-drupal/drupal-glossary/module)
- [Plugin API](/hc/documentation/learn-drupal/drupal-glossary/plugin-api)
- [Drupal Canvas (formerly Experience Builder)](/hc/documentation/learn-drupal/drupal-glossary/drupal-canvas)
- [Render API](/hc/documentation/learn-drupal/drupal-glossary/render-api)

 [All Drupal terms from A to Z](/hc/documentation/learn-drupal/drupal-glossary)

Single Directory Components (SDC) are Drupal core's way of packaging one piece of user interface, such as a card or a button, in a single folder. The folder holds a YAML file that describes the component and its inputs, a Twig template for the markup, and optional CSS and JavaScript files. Templates can then reuse the component by name.

## How it works in Drupal 11

SDC became part of core's render system in Drupal 10.3. The [module](/hc/documentation/learn-drupal/drupal-glossary/module) and [theme](/hc/documentation/learn-drupal/drupal-glossary/theme) folders are scanned for a `components` directory (I read this in the `ComponentPluginManager` class of Drupal core 11.4.10). Each component sits in its own subfolder and its files share one name, for example `components/notice/notice.component.yml` and `notice.twig`.

The YAML file holds the component metadata. The keys `name`, `status`, `props`, `slots`, `variants`, `tags` and `libraryOverrides` are all in core's metadata schema. The `status` value must be one of `experimental`, `stable`, `deprecated` or `obsolete`. Props use JSON Schema. Core checks the values passed in against it, but it does so inside a PHP `assert()` call, so the check runs only where PHP assertions are enabled. If a `notice.css` or `notice.js` file exists next to the template, Drupal turns it into a library and attaches it when the component is used.

You call a component by its id, which is the extension name, a colon and the base name of its YAML file, such as `olivero:teaser`. In Twig you use `include` or `embed`. In PHP you use a render array with `'#type' => 'component'` and `'#component'`. Core 11.4.10 ships real examples: Olivero's `teaser` component and several components in the Umami demo theme.

## Example

A notice component in a custom theme needs two files. First, `my_theme/components/notice/notice.component.yml`:

```yaml
name: Notice
        status: stable
        props:
          type: object
          required:
            - tone
          properties:
            tone:
              type: string
              title: Tone
              enum: [info, warning]
        slots:
          body:
            title: Body
```

Second, `notice.twig`, where the slot is a Twig block:

```twig
<div class="notice notice--{{ tone }}">
          {% block body %}{% endblock %}
        </div>
```

Any template can then fill it in with `{% embed 'my_theme:notice' with { tone: 'warning' } only %}{% block body %}Back up first.{% endblock %}{% endembed %}`.

## Common mistakes

- **Forgetting the cache.** The quickstart tells you to clear the cache after you create a component; until then Drupal does not find it.
- **Relying on prop validation in production.** Because the check sits inside `assert()`, a wrong value may pass unnoticed on a server where assertions are off. Test with assertions on.
- **Passing markup as a prop.** Props describe data. Put markup in a slot.
- **Mismatched file names.** Core takes the component name from the YAML file and looks for the Twig, CSS and JavaScript files under that same name, so a `notice.component.yml` next to a `card.twig` has no template.
- **Leaving `status: experimental` on a finished component.** The metadata schema describes that field as telling people whether the component can be safely used in production.

## For marketing and content teams

Editors never touch the YAML or Twig. You feel SDC when a developer builds each design element once and every page that uses it stays consistent. It also matters for page builders: [Drupal Canvas](/hc/documentation/learn-drupal/drupal-glossary/drupal-canvas) offers SDCs from a theme or module as pieces an editor can place visually. If your team plans a component library, ask developers to give every prop a clear title, because that is the text people will see.

## Sources

- [Drupal.org: Using Single-Directory Components](https://www.drupal.org/docs/develop/theming-drupal/using-single-directory-components)
- [Drupal.org: Single-Directory Components quickstart](https://www.drupal.org/docs/develop/theming-drupal/using-single-directory-components/quickstart)
- [Drupal.org: Single Directory Components project page](https://www.drupal.org/project/sdc)
- [Drupal.org: Change record for obsolete modules (SDC section)](https://www.drupal.org/node/3223395)
- [Drupal core 11.4.10: ComponentPluginManager and component metadata schema](https://git.drupalcode.org/project/drupal/-/blob/11.4.10/core/lib/Drupal/Core/Theme/ComponentPluginManager.php)
- [Drupal Canvas 1.12.0: components documentation](https://git.drupalcode.org/project/canvas/-/blob/1.12.0/docs/components.md)

## Questions about Single Directory Components

### Do I need to enable a module to use Single Directory Components?

No. SDC has been part of core's theming system since Drupal 10.3, and the project page says you do not need the contributed module. In Drupal 11.4.10 the old Single-Directory Components module is a hidden, obsolete stub; the change record says it can be uninstalled.

### What is the difference between a prop and a slot?

A prop is a named input with a type that you describe in JSON Schema, such as a string limited to a list of values. A slot is a named area that holds markup you pass in, such as the body of a notice. In the Twig file, a prop is a variable and a slot is a block.

### Can a module provide components as well as a theme?

Yes. The plugin manager scans the `components` folder of every installed module and theme. One difference matters: a module's components must have a schema, while a theme's components need one only if the theme's info file sets `enforce_prop_schemas` to true.

### How does Drupal Canvas use Single Directory Components?

Canvas lists SDCs as one of its component types. Its 1.12.0 documentation lists the rules a component must meet, among them a props schema (even in a theme), a title on every prop and slot, an example for each required prop, and no `obsolete` status or `noUi: true` flag.

 ## Cite this definition

"Single Directory Components." DXPR Drupal glossary, https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/single-directory-components. Last updated October 26, 2026.

 Copy  ## Related terms

- [Twig](/hc/documentation/learn-drupal/drupal-glossary/twig)
- [Theme](/hc/documentation/learn-drupal/drupal-glossary/theme)
- [Module](/hc/documentation/learn-drupal/drupal-glossary/module)
- [Plugin API](/hc/documentation/learn-drupal/drupal-glossary/plugin-api)
- [Drupal Canvas (formerly Experience Builder)](/hc/documentation/learn-drupal/drupal-glossary/drupal-canvas)
- [Render API](/hc/documentation/learn-drupal/drupal-glossary/render-api)

[All Drupal terms from A to Z](/hc/documentation/learn-drupal/drupal-glossary)