Skip to content

Commit 4e395d7

Browse files
committed
update components
1 parent 4dd2a20 commit 4e395d7

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

‎docs/components/create-a-component/index.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@ This method automatically:
4040
::: warning
4141
If the extracted elements depend on variables or formulas from the original component or page, these connections will break after extraction. You will need to rearrange these dependencies.
4242
:::
43+
44+
::: tip
45+
For a video walkthrough of creating a component, check out the following lesson from the [Nordcraft Fundamentals](https://nordcraft.com/learn/fundamentals) video course.
46+
:::
47+
48+
@@@ youtube
49+
videoId: JFKB1IbReyE
50+
title: Creating and using components
51+
@@@

‎docs/components/overview/index.md‎

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Component fundamentals
3-
description: Learn how components work in Nordcraft, and how using components can help you build maintanable, organized, and powerful websites.
3+
description: Learn how components work in Nordcraft, and how using components can help you build maintanable and organized websites.
44
---
55

66
# Components in Nordcraft
77

8-
Components are the fundamental building blocks of websites in Nordcraft. Using components, you can create reusable parts of your website and break large projects down into smaller, more manageable pieces.
8+
You can use components in Nordcraft to break down large projects into smaller reusable building blocks for your websites in Nordcraft.
99

1010
Components in Nordcraft are self-contained, reusable elements that encapsulate structure, styles and behavior. Components can:
1111

@@ -18,14 +18,14 @@ Components in Nordcraft are self-contained, reusable elements that encapsulate s
1818
- Implement functionality in isolation
1919
- Maintain their own internal state
2020

21-
Each component has its own structure, data model, and behavior. This makes components neatly reusable across your project. The encapsulation of both UI and logic creates building blocks that can be combined to create increasingly sophisticated websites.
21+
Each component has its own structure, data model, and behavior.
2222

2323
::: info
2424
Components combine HTML structure, CSS styles, and interactive JavaScript behavior into reusable parts.
2525
:::
2626

2727
::: dev
28-
Nordcraft components work in very similar ways to other JavaScript frameworks like React, Vue, and Svelte.
28+
Nordcraft components work in very similar ways to how components work in other JavaScript frameworks like React, Vue, and Svelte.
2929
:::
3030

3131
## Benefits of using components
@@ -59,26 +59,12 @@ A component in Nordcraft can consist of:
5959

6060
### Data encapsulation
6161

62-
Components in Nordcraft encapsulate their data, meaning that variables, APIs, and other internal aspects of one component are not accessible by other components. At first, this isolation may seem limiting, but it's an essential design principle that helps maintain order as your project grows in complexity.
63-
64-
This encapsulation ensures that components:
62+
Components in Nordcraft encapsulate their data, meaning that variables, APIs, and other internal aspects of one component are not accessible by other components. This ensures that components:
6563

6664
- Have clear boundaries and responsibilities
6765
- Can be modified internally without affecting other parts of the project
6866
- Are easier to understand, as their behavior depends only on their own code and inputs
6967

70-
::: info
71-
Each component is like a `black box` that hides its implementation details while exposing a clear interface.
72-
:::
73-
74-
### Component composition
75-
76-
Components are composable, meaning they can be combined together to form more complex components. This composition model allows you to:
77-
78-
- Create a hierarchy of increasingly complex UI elements
79-
- Build websites with reusable parts
80-
- Share functionality between different areas of your website
81-
8268
Components can send data to other components and pages through:
8369

8470
- **Attributes**: Pass data down to child components
@@ -87,12 +73,18 @@ Components can send data to other components and pages through:
8773

8874
This communication pattern enables components to work together while maintaining their independence and encapsulation.
8975

76+
### Component composition
77+
78+
Components are composable, meaning they can be combined together to form more complex components. This allows you to:
79+
80+
- Create a hierarchy of increasingly complex UI elements
81+
- Build large websites with reusable parts
82+
- Share functionality between different areas of your website
83+
9084
## Working with component instances
9185

9286
When you add a component to a page or another component, you're creating an instance of that component. Each instance:
9387

9488
- Has its own set of attribute values
9589
- Can be styled independently (affecting only the root element, see [component style overrides](/styling/conditional-styles#component-style-overrides))
9690
- Works independently of other instances of the same component
97-
98-
Understanding how components work and how they fit into the overall structure of your project is the foundation for creating maintainable, scalable websites in Nordcraft.

0 commit comments

Comments
 (0)