2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-12-27 17:33:49 +01:00
|
|
|
title: "@freesewing/plugin-buttons"
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-12-27 17:33:49 +01:00
|
|
|
The **@freesewing/plugin-buttons** plugin provides the following [snippets](/reference/api/snippets):
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-20 14:44:38 +01:00
|
|
|
- [button](/reference/api/snippets/button)
|
|
|
|
- [buttonhole](/reference/api/snippets/buttonhole)
|
|
|
|
- [buttonhole-start](/reference/api/snippets/buttonhole-start)
|
|
|
|
- [buttonhole-end](/reference/api/snippets/buttonhole-end)
|
|
|
|
- [snap-stud](/reference/api/snippets/snap-stud)
|
|
|
|
- [snap-socket](/reference/api/snippets/snap-socket)
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-12-27 17:33:49 +01:00
|
|
|
<Example part="plugin_buttons">
|
|
|
|
An example of the button, buttonhole, buttonhole-start, buttonhole-end, snap-stud, and snap-socket snippets
|
|
|
|
</Example>
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
<Tip>
|
|
|
|
|
|
|
|
The buttons plugin is part of our [plugin-bundle](/reference/plugins/bundle)
|
|
|
|
|
|
|
|
</Tip>
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm install @freesewing/plugin-buttons
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2021-12-27 17:33:49 +01:00
|
|
|
Like all [build-time plugins](/guides/plugins/types-of-plugins#build-time-plugins), you
|
|
|
|
load them by passing them to the [freesewing.Design](/reference/api/design) super-constructor:
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
import freesewing from "@freesewing/core";
|
|
|
|
import buttons from "@freesewing/plugin-buttons";
|
|
|
|
import config from "../config";
|
|
|
|
|
|
|
|
const Pattern = new freesewing.Design(config, buttons);
|
|
|
|
```
|
2021-10-17 18:26:00 +02:00
|
|
|
|
2021-12-27 17:33:49 +01:00
|
|
|
Now you can use the
|
2022-02-19 08:04:25 +01:00
|
|
|
[button](/reference/api/snippets/button),
|
|
|
|
[buttonhole](/reference/api/snippets/buttonhole),
|
|
|
|
[buttonhole-start](/reference/api/snippets/buttonhole-start),
|
|
|
|
[buttonhole-end](/reference/api/snippets/buttonhole-end),
|
|
|
|
[snap-stud](/reference/api/snippets/snap-stud), and
|
2021-12-27 17:33:49 +01:00
|
|
|
[snap-socket](/reference/api/snippets/snap-socket)
|
|
|
|
snippets in your designs.
|