
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@base-framework/ui
Advanced tools
This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.
Version: 1.0.0
This documentation aims to guide the enhancement of component scalability and reusability within your projects through the use of organisms. Organisms are designed to function as the medium building blocks in a component-based architecture.
This module will add default organisms to your project.
If you need to learn about atomic design, please refer to the Atomic Design documentation.
To learn more about Base framework or how to build atoms, refer to the Base documentation.
Organisms can be created using atoms, other organisms, and components. Atoms are the smallest building blocks of a component, while components are composed of atoms and other components. Organisms are a collection of atoms and components that form a larger structure.
// Atom
const Link = Atom((props, children) => ({
...props,
children,
tag: 'a',
}));
// Organism Atom
const Link = Atom((props, children) => (
Link({...props }, [
Icon({ class: 'icon' }),
children
])
));
// Organism Atom with Component
const Link = Atom((props, children) => (
Nav([
Ul([
Li([
Link([
Icon({ class: 'icon' }),
Span('Text')
])
])
])
]),
new List({...props }, [
children
])
));
// Organism Function with Component
const List = (props, children) => Div([
Header([
H1('Title')
]),
new List({...props }, [
children
])
]);
Organisms should use composition to nest other atoms, organisms, or components.
const SecondaryButton = Atom((props, children) => (Button({
...props,
class: 'secondary-btn',
children
}));
To leverage an organism, invoke its function and pass the requisite values via a props and children. The organisms created with the Atom callback functions support passing optional props or children to the atom. The props object should always be first but if the atom does not require props, the children array or string can be passed as the first argument.
// props only
Div({class: 'text'});
// text child only
Div('test');
// array child only
Div([
Div('test')
]);
// props and text child
Div({class: 'text'}, 'test');
// props and array children
Div({class: 'text'}, [
Div('test'),
Div('test')
]);
SecondaryButton({
click(e) =>
{
// Handle the click event
}
})
FAQs
This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.
We found that @base-framework/ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.