This library contains a collection of reusable and framework-agnostic Web Components that can be easily integrated into any web project. No need for complex setups or frameworks. Simply add the code to your projects and start using them.
-
u-checkbox
- Customizable checkbox -
u-button
- Button with support for variants, sizes, and accessibility -
u-card
- Card component with header, body, and footer
-
u-icon-button
- Compact button with an icon only -
u-toggle-button
- Toggle button (on/off) -
u-switch
- Styled switch -
u-radio
- Radio button -
u-input
- Text input field -
u-textarea
- Multiline text input -
u-select
- Dropdown select field -
u-slider
- Range slider -
u-file-upload
- File upload input
-
u-container
- Responsive layout container -
u-grid
- Flexible grid system -
u-row
&u-column
- Row and column-based layout -
u-divider
- Visual separator line -
u-stack
- Spacing management component -
u-dialog
- Modal/Dialog box
-
u-avatar
- User profile avatar -
u-badge
- Small visual indicator (e.g., notifications) -
u-tooltip
- Tooltip for additional info on hover -
u-progress
- Progress bar -
u-spinner
- Loading indicator -
u-toast
- Floating notifications
-
u-list
- Standard list -
u-list-item
- List item with icon and actions -
u-table
- Customizable table -
u-pagination
- Pagination component
-
u-tabs
- Tabbed navigation -
u-navbar
- Navigation bar -
u-sidebar
- Side menu -
u-breadcrumbs
- Breadcrumb navigation -
u-accordion
- Expandable/collapsible section
-
u-icon
- Customizable icons -
u-carousel
- Image/content slider -
u-collapse
- Collapsible section -
u-alert
- Alert box
If you are using npm to manage your dependencies, run the following command:
npm install universal-wc
If you prefer not to use npm, you can simply add the JavaScript file directly to your HTML:
<script src="https://cdn.jsdelivr.net/npm/universal-wc/dist/universal-wc.es.js"></script>
Once installed, you can start using the components directly in your HTML code.
<u-card>
<div slot="top">Title</div>
<p>Lorem Ipsum</p>
<span slot="bottom">
<u-button>Button Text</u-button>
</span>
</u-card>
The library uses Shadow DOM, so you can style the components within the component's scope directly. If you need further customization, you can use global styles or CSS Variables.
To visualize the components and test their appearance, you can run Storybook.
-
Install Storybook dependencies:
npm install @storybook/web-components --save-dev
-
Run Storybook:
After installation, run the following command to start Storybook and view your components:
npm run storybook
This will open Storybook at
http://localhost:6006
, where you can view all available components.
If you'd like to contribute to the library, follow these steps:
-
Fork the repository.
-
Clone the repository to your local machine:
git clone https://github.com/adeirjunior/universal-wc.git cd universal-wc npm install
-
Create a new branch for your changes:
git checkout -b my-new-feature
-
Make your changes and submit a pull request.
All contributions are welcome!
This library is licensed under the MIT License. See the LICENSE file for more details.