Overview
Framework and Utilities
Angular
React
Vue
Blazor
Integrations
Roadmap
Release Notes
Accessibility
Theme Builder
Grid
Gantt Chart
Scheduler
CardView
Chart
Editor
DockingLayout
Kanban
PivotTable
Table
Accordion
Badge
Barcode
Button
Breadcrumb
Card
Carousel
Calendar
CheckBox
ComboBox
ColorPicker
DateTimePicker
DropDownList
DropDownButton
FileUpload
Form
Gauge
Input
ListBox
ListMenu
Layout
MaskedTextBox
Menu
MultilineTextBox
MultiSplitButton
NumericTextBox
Pager
PasswordTextBox
PowerButton
ProgressBar
QueryBuilder
RadioButton
Rating
RepeatButton
Ribbon Bar
Qrcode
ScrollBar
Slider
Splitter
SwitchButton
Sortable
Tabs
Tank
TextBox
TimePicker
Toast
ToggleButton
Tooltip
Tree
Window
Create a Custom Element
View Model Binding
Data Adapter
Data Exporter
Conditional Formatter
Shadow Dom
Router
Validator
Date API
Numeric API
Drawing API
Localization
Comparison with Others
Overview
WAI-ARIA Support
Section 508 Support
WCAG Compliance
Keyboard Shortcuts
Right-to-left Languages
Overview
Using with Angular
Component NPM packages
Template-driven Forms
Forms Custom Validation
Reactive Forms
Angular Signals
Angular Universal - Server side Rendering
Angular Grid
Angular Grid Data Service
NGX Translate Grid
Angular Grid Refresh Data Source
ngFor Directive
Angular HTTP and Grid CRUD
Dynamic Forms
Form Numeric Validation
Notification Angular Service
Angular routing with Tabs
Angular routing with Splitter
Angular routing with Accordion
Angular Component in Grid column
Refresh Grid data source
Dynamic Components in Tabs
Dynamic Table with ng-for
Angular Debug with VS Code
Angular RxJS
Angular RxJS Server Paging
Angular Azure Face API
Angular Azure Cosmos DB
Angular Electron with Grid
Angular Grid Editing with Form
Angular Grid as Standalone
Angular Gantt as Standalone
Angular Scheduler as Standalone
Using with React
React with Typescript
Using the state Hook
React Grid
NextJS & Grid
Next JS with SSR
Vite
React Kanban Remote data
React Scheduler & MySQL
React Scheduler & MongoDB
React Grid Remote Data
React Grid Edit with Form
React Grid Styling
React Grid CRUD
React Hooks in Grid
React Components in Grid cells
React Grid CRUD with Express JS and MySQL
React Grid and GraphQL
Using with Vue 3
Using with Vue 3 & Typescript
Using with Vue 3 Composition API
Using with Vue 2
Using ListBox with Vue 2
Vue Routing
Vue Grid Data Bind
Using with Blazor & .NET 8, 9
Using with Blazor & .NET 5, 6, 7
Using Blazor with JS Components
Two-way Binding
Localization
Adding to Toolbox
Web Assembly CRUD Application
PWA Application
Desktop Application
.NET MAUI & Blazor
Full-stack app with GraphQL
Full-stack app with GraphQL(2)
Blazor CardView
Setup CardView
Cardview Editing
Cardview Scroll
Blazor Chart
Setup Chart
Chart Axes
Chart Formatting
Chart Polar/Spider
Chart Types
Blazor Editor
Setup Editor
Editor Find & Replace
Editor Inline toolbar
Editor markdown
Editor methods
Editor Paste format
Editor toolbar
Editor toolbar items
Custom toolbar items(JSInterop)
Editor Image Upload
Blazor Docking Layout
Blazor Gantt
Setup Gantt
Gantt Data Bind
Gantt Data Bind to JSON
Gantt events
Gantt export
Gantt header
Gantt nonworking-time
Gantt resources
Gantt Customization
Gantt Timeline
Gantt Custom Header(JSInterop)
Blazor Grid
Setup Grid
Grid Column Menu
Grid Columns Bind
Grid Columns Command Menu
Grid Columns Format
Grid Columns Freeze
Grid Columns Group
Grid Columns Reorder
Grid Columns Resize
Grid Data Bind to CSV
Grid Data Bind to Enumerable
Grid Data Bind to JSON
Grid Data Bind to SQL
Grid Data Bind to Web API
Grid Events
Grid Export
Grid Editing
Grid Filter
Grid Grouping
Grid Paging
Grid Refresh Data
Grid Selection
Grid Server side Crud
Localization
OData binding
Dynamic Template(JSInterop)
Custom Editor
Custom Tooltips
Blazor Inputs
Button
Switch Button
Radio Button
Repeat Button
Dropdown Button
Toggle Button
Progress Bar
Checkbox
Card
Check Input
Multicombo Input
Multi Input
Number Input
Numeric Textbox
Date/Time Picker
Date Range Input
Date Input
Calendar
Slider
Masked TextBox
Password TextBox
File Upload
File Upload handle Files
Dropdownlist
Dropdownlist with Label & Value
Combobox
Combobox with Label & Value
Color Picker
Time Picker
Tank
Blazor Kanban
Setup Kanban
Kanban Nested columns
Kanban SQL bind
Kanban Server Side CRUD
Blazor Pivot
Setup Pivot Table
Pivot Table Columns
Pivot Table Designer
Pivot Table Export
Pivot Table Toolbar
Pivot Table Totals
Blazor Scheduler
Setup Scheduler
Scheduler Agenda view
Scheduler Data Bind to JSON
Scheduler Day View
Scheduler Edit Events
Scheduler Month View
Scheduler Timeline Day View
Scheduler Timeline Month View
Scheduler Timeline Week View
Scheduler Views
Scheduler Week View
Scheduler Custom Footer(JSInterop)
Scheduler SQL bind
Scheduler Server Side CRUD
Blazor Table
Setup Table
Table Change Columns
Table Column Hierarchy
Table Header and Footer
Table Selection
Blazor Accordion
Blazor Tabs
Blazor Tree
Blazor Form
Blazor Form Value Handling
Blazor Query Builder
Blazor ListMenu
Blazor Toast
Blazor Pager
Blazor Menu
Blazor Gauge
Blazor Sortable
Blazor Carousel
Blazor Window
Misc
Tabs Selection
Hide Calendar Weekends
API
Accordion API
Accordion Item API
Button API
Button group API
Breadcrumb API
Card API
Cardview API
Carousel API
Color input API
Country input API
Color picker API
Combobox API
Calendar API
Dropdown list API
Date/time picker API
Date range input API
Date input API
Docking layout API
Dropdown button API
Editor API
File upload API
Form API
Form control API
Form group API
Gantt API
Gauge API
Grid API
Input API
Kanban API
Layout API
Layout group API
Layout item API
List box API
List item API
Masked textbox API
Menu API
Menu item API
Menu items group API
Multi combo input API
Multi input API
Numeric input API
Numeric textbox API
Pager API
Password input API
Password textbox API
Pivot Table API
Phoneinput API
Progressbar API
Query Builder API
Radio Button API
Rating API
Scheduler API
Scrollbar API
Slider API
Splitter API
Tank API
Textbox API
Textarea API
Tabs API
Toast API
TimeInput API
TimePicker API
Tree API
TreeItem API
Window API
Using with Typescript
Using with Lit Element
Using with Sharepoint
Using with PHP & MYSQL
Using with Meteor
Using with Ionic
Using with Stencil
Using Smart.Window with Stencil
Using with Svelte
Using with Electron
Using with Azure Cosmos DB
Using Firebase & OAuth2
Using with AWS DynamoDB
Using with NX(Angular & React)
Using with Webpack
Build ES6 modules with Webpack
Overview
Accessibility
CSS Styling
API
Overview
CSS Styling
Overview
Chart Styling
Chart Formatting
Chart Axes
Chart Types
API
3D Chart Axes
3D Chart Formatting
3D Chart Controls
3D Chart Styling
3D Chart Types
3D Chart API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Editor Toolbar
Context Menu
Auto Save
Iframe mode
Find & Replace
Editor Methods
Markdown
Dialogs
Video
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Data bind
Column definitions
Column headers
Column reorder
Context menu
Row Filtering
Row Freeze
Row IDs
Row Reorder
Row Resize
Row Sort
Row Span
Header & Footer
Editing
Cell Editing
Cell Templates
Filtering & Sorting
Grouping
Grouping: Expanding Groups
Paging
Nested Grids
Tree Grid
Rows & Columns
Get Row or Cell
Cascading Cell Editors
Conditional Row Select
Export
Export: Selected Records
Firebase & OAuth2
Using with AWS DynamoDB
Using with NodeJS and MySQL
Scrolling
Selection
Accessibility
Localization
Multi users support
Smart.Grid vs Smart.Table
CSS Styling
Appearance
Formulas
Styling Cells
Styling Rows
API
Overview
Gantt Editing
Gantt Sorting
Gantt Filtering
Gantt Tasks Tree
Gantt Timeline
Gantt Backend Storage
Gantt Resource Management
Gantt Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
MultiInput API
CheckInput API
MultiComboInput API
NumberInput API
DateInput API
DateRangeInput API
TimeInput API
ColorInput API
TextArea API
API
Overview
Accessibility
Kanban Complex layouts
Kanban Editing Customization
Kanban User comments
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
Query Parser
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
CSS Styling
API
Overview
CSS Styling
API
Overview
Current Time Indicator
Drag & Resize Events
Scheduler Events
Google Calendar Sync
Google Calendar Import/Export
Custom Header
Import & Export Events
Menus
Methods
Resources & Grouping
Time table
Time zones
Views
Windows
Signal R Integration
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Overview
Accessibility
CSS Styling
API
Build your web apps using Smart UI
Smart.Table is created to replace and extend the HTML Table tag with custom styles, hover effects, sorting and data related capabilities.
Smart UI for Web Components is distributed assmart-webcomponents NPM package
npm install smart-webcomponents
<script type="module" src="node_modules/smart-webcomponents/source/modules/smart.table.js"></script>
<link rel="stylesheet" type="text/css" href="node_modules/smart-webcomponents/source/styles/smart.default.css" />
<smart-table id="table"></smart-table>
<script type="module">Smart('#table', class {get properties() {return sortMode: "many"}});</script>
const table = document.createElement('smart-table');table.disabled = true;document.body.appendChild(table);
import "../../source/modules/smart.table.js";document.readyState === 'complete' ? init() : window.onload = init;function init() { const table = new Smart.Table('#table', sortMode: "many");}
Add ".table-bordered" for borders on all sides of the table and cells.
See the Pen Table Bordered Demo by Boyko Markov (@boyko-markov) onCodePen.
Add ".table-dark" to make the table with Dark Background and White Color.
See the Pen Table Dark Bordered Demo by Boyko Markov (@boyko-markov) onCodePen.
Add sort-mode="one" or sort-mode="many" to make the table Sortable by one or many columns. To sort the table through the API, use "sortBy" method and pass two arguments - Column's Name and 'asc', 'desc' or null to sort ascending, descending or remove the column's sort.
See the Pen Table Sort Demo by Boyko Markov (@boyko-markov) onCodePen.
Use .table-striped to add zebra-striping.
Responsive tables make them easily scrollable. To make the Smart.Table responsive across all viewports, use the ".table-responsive" CSS class. Or, pick a maximum breakpoint with which to have a responsive table up to by using .table-responsive{-sm|-md|-lg|-xl}.
Use .table-responsive{-sm|-md|-lg|-xl} as needed to create the responsive element up to a particular breakpoint. From that breakpoint and up, the web component will behave normally and not scroll horizontally.
const table = document.createElement('smart-table');
document.body.appendChild(table);
table.parentNode.removeChild(table);
table.propertyName = propertyValue;
const propertyValue = table.propertyName;
table.methodName(argument1, argument2);
const eventHandler = (event) => { // your code here.};table.addEventListener(eventName, eventHandler);
table.removeEventListener(eventName, eventHandler, true);
Smart Web Components package includes TypeScript definitions which enables strongly-typed access to the Smart UI Components and their configuration.
Inside the download package, the typescript directory contains .d.ts file for each web component and a smart.elements.d.ts typescript definitions file for all web components. Copy the typescript definitions file to your project and in your TypeScript file add a reference tosmart.elements.d.ts
Read more about using Smart UI with Typescript.Angular provides the easiest way to set angular CLI projects using Angular CLI tool.
Install the CLI application globally to your machine.
npm install -g @angular/cli
ng new smart-angular-table
Navigate to the created project folder
cd smart-angular-table
Smart UI for Angular is distributed assmart-webcomponents-angular NPM package
npm install smart-webcomponents-angular
@import 'smart-webcomponents-angular/source/styles/smart.default.css';
"styles": ["node_modules/smart-webcomponents-angular/source/styles/smart.default.css"]If you want to use Bootstrap, Fluent or other themes available in the package, you need to add them after 'smart.default.css'.
<div class="demo-description">Our Table web component can be used to wrap or replace standard Tables and add different styles, hover effects, sorting by one or multiple columns, add, remove and update rows.</div><smart-table #table id="table"> <table> <thead> <tr> <th scope="col">Country</th> <th scope="col">Area</th> <th scope="col">Population_Rural</th> <th scope="col">Population_Total</th> <th scope="col">GDP_Total</th> </tr> </thead> <tbody> <tr> <td>Brazil</td> <td>8515767</td> <td>0.15</td> <td>205809000</td> <td>2353025</td> </tr> <tr> <td>China</td> <td>9388211</td> <td>0.46</td> <td>1375530000</td> <td>10380380</td> </tr> <tr> <td>France</td> <td>675417</td> <td>0.21</td> <td>64529000</td> <td>2846889</td> </tr> <tr> <td>Germany</td> <td>357021</td> <td>0.25</td> <td>81459000</td> <td>3859547</td> </tr> <tr> <td>India</td> <td>3287590</td> <td>0.68</td> <td>1286260000</td> <td>2047811</td> </tr> <tr> <td>Italy</td> <td>301230</td> <td>0.31</td> <td>60676361</td> <td>2147952</td> </tr> <tr> <td>Japan</td> <td>377835</td> <td>0.07</td> <td>126920000</td> <td>4616335</td> </tr> <tr> <td>Russia</td> <td>17098242</td> <td>0.26</td> <td>146544710</td> <td>1857461</td> </tr> <tr> <td>United States</td> <td>9147420</td> <td>0.19</td> <td>323097000</td> <td>17418925</td> </tr> <tr> <td>United Kingdom</td> <td>244820</td> <td>0.18</td> <td>65097000</td> <td>2945146</td> </tr> </tbody> </table></smart-table>
import { Component, ViewChild, OnInit, AfterViewInit } from '@angular/core';import { TableComponent, TableColumn } from 'smart-webcomponents-angular/table';import { CommonModule } from '@angular/common';import { RouterOutlet } from '@angular/router';import { TableModule } from 'smart-webcomponents-angular/table';@Component({ selector: 'app-root',standalone: true,imports: [CommonModule, TableModule, RouterOutlet],templateUrl: './app.component.html',styleUrls: ['./app.component.css']})export class AppComponent implements AfterViewInit, OnInit {@ViewChild('table', { read: TableComponent, static: false }) table!: TableComponent; ngOnInit(): void {// onInit code.}ngAfterViewInit(): void {// afterViewInit code.this.init(); }init(): void {// init code. }}
<div class="demo-description">Our Table web component can be used to wrap or replace standard Tables and add different styles, hover effects, sorting by one or multiple columns, add, remove and update rows.</div><smart-table #table id="table"> <table> <thead> <tr> <th scope="col">Country</th> <th scope="col">Area</th> <th scope="col">Population_Rural</th> <th scope="col">Population_Total</th> <th scope="col">GDP_Total</th> </tr> </thead> <tbody> <tr> <td>Brazil</td> <td>8515767</td> <td>0.15</td> <td>205809000</td> <td>2353025</td> </tr> <tr> <td>China</td> <td>9388211</td> <td>0.46</td> <td>1375530000</td> <td>10380380</td> </tr> <tr> <td>France</td> <td>675417</td> <td>0.21</td> <td>64529000</td> <td>2846889</td> </tr> <tr> <td>Germany</td> <td>357021</td> <td>0.25</td> <td>81459000</td> <td>3859547</td> </tr> <tr> <td>India</td> <td>3287590</td> <td>0.68</td> <td>1286260000</td> <td>2047811</td> </tr> <tr> <td>Italy</td> <td>301230</td> <td>0.31</td> <td>60676361</td> <td>2147952</td> </tr> <tr> <td>Japan</td> <td>377835</td> <td>0.07</td> <td>126920000</td> <td>4616335</td> </tr> <tr> <td>Russia</td> <td>17098242</td> <td>0.26</td> <td>146544710</td> <td>1857461</td> </tr> <tr> <td>United States</td> <td>9147420</td> <td>0.19</td> <td>323097000</td> <td>17418925</td> </tr> <tr> <td>United Kingdom</td> <td>244820</td> <td>0.18</td> <td>65097000</td> <td>2945146</td> </tr> </tbody> </table></smart-table>
import { Component, ViewChild, OnInit, AfterViewInit } from '@angular/core';import { TableComponent, TableColumn } from 'smart-webcomponents-angular/table';@Component({ selector: 'app-root',templateUrl: './app.component.html',styleUrls: ['./app.component.css']})export class AppComponent implements AfterViewInit, OnInit {@ViewChild('table', { read: TableComponent, static: false }) table!: TableComponent; ngOnInit(): void {// onInit code.}ngAfterViewInit(): void {// afterViewInit code.this.init(); }init(): void {// init code. }}
import { NgModule } from '@angular/core';import { BrowserModule } from '@angular/platform-browser';import { TableModule } from 'smart-webcomponents-angular/table';import { AppComponent } from './app.component';@NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, TableModule ], bootstrap: [ AppComponent ]})export class AppModule { }
After completing the steps required to render a Table, run the following command to display the output in your web browser
ng serveand open localhost:4200 in your favorite web browser.
Read more about using Smart UI for Angular:https://www.htmlelements.com/docs/angular-cli/.
The easiest way to start with React is to useNextJS Next.js is a full-stack React framework. It’s versatile and lets you create React apps of any size—from a mostly static blog to a complex dynamic application.
npx create-next-app my-appcd my-appnpm run devor
yarn create next-app my-appcd my-appyarn run dev
Smart UI for React is distributed assmart-webcomponents-react package
With NPM:
npm install smart-webcomponents-reactWith Yarn:
yarn add smart-webcomponents-react
import 'smart-webcomponents-react/source/styles/smart.default.css';import React from "react";import ReactDOM from 'react-dom/client';import { Table } from 'smart-webcomponents-react/table';class App extends React.Component {init() {}componentDidMount() {this.init();}render() {return (<div> <div className="demo-description">Our Table web component can be used to wrap or replace standard Tables and add different styles, hover effects, sorting by one or multiple columns, add, remove and update rows.</div> <Table id="table"> <table> <thead> <tr> <th scope="col">Country</th> <th scope="col">Area</th> <th scope="col">Population_Rural</th> <th scope="col">Population_Total</th> <th scope="col">GDP_Total</th> </tr> </thead> <tbody> <tr> <td>Brazil</td> <td>8515767</td> <td>0.15</td> <td>205809000</td> <td>2353025</td> </tr> <tr> <td>China</td> <td>9388211</td> <td>0.46</td> <td>1375530000</td> <td>10380380</td> </tr> <tr> <td>France</td> <td>675417</td> <td>0.21</td> <td>64529000</td> <td>2846889</td> </tr> <tr> <td>Germany</td> <td>357021</td> <td>0.25</td> <td>81459000</td> <td>3859547</td> </tr> <tr> <td>India</td> <td>3287590</td> <td>0.68</td> <td>1286260000</td> <td>2047811</td> </tr> <tr> <td>Italy</td> <td>301230</td> <td>0.31</td> <td>60676361</td> <td>2147952</td> </tr> <tr> <td>Japan</td> <td>377835</td> <td>0.07</td> <td>126920000</td> <td>4616335</td> </tr> <tr> <td>Russia</td> <td>17098242</td> <td>0.26</td> <td>146544710</td> <td>1857461</td> </tr> <tr> <td>United States</td> <td>9147420</td> <td>0.19</td> <td>323097000</td> <td>17418925</td> </tr> <tr> <td>United Kingdom</td> <td>244820</td> <td>0.18</td> <td>65097000</td> <td>2945146</td> </tr> </tbody> </table> </Table></div>);}}export default App;
npm run devor
yarn run devandopen localhost:3000 in your favorite web browser to see the output.
npm create vite@latestWith Yarn:
yarn create viteThen follow the prompts and choose React as a project.
Navigate to your project's directory. By default it is 'vite-project' and install Smart UI for React
In your Vite project, run one of the following commands to install Smart UI Table for ReactWith NPM:
npm install smart-webcomponents-reactWith Yarn:
yarn add smart-webcomponents-reactOpen src/App.tsxApp.tsx
import 'smart-webcomponents-react/source/styles/smart.default.css';import React from "react";import ReactDOM from 'react-dom/client';import { Table } from 'smart-webcomponents-react/table';class App extends React.Component {init() {}componentDidMount() {this.init();}render() {return (<div> <div className="demo-description">Our Table web component can be used to wrap or replace standard Tables and add different styles, hover effects, sorting by one or multiple columns, add, remove and update rows.</div> <Table id="table"> <table> <thead> <tr> <th scope="col">Country</th> <th scope="col">Area</th> <th scope="col">Population_Rural</th> <th scope="col">Population_Total</th> <th scope="col">GDP_Total</th> </tr> </thead> <tbody> <tr> <td>Brazil</td> <td>8515767</td> <td>0.15</td> <td>205809000</td> <td>2353025</td> </tr> <tr> <td>China</td> <td>9388211</td> <td>0.46</td> <td>1375530000</td> <td>10380380</td> </tr> <tr> <td>France</td> <td>675417</td> <td>0.21</td> <td>64529000</td> <td>2846889</td> </tr> <tr> <td>Germany</td> <td>357021</td> <td>0.25</td> <td>81459000</td> <td>3859547</td> </tr> <tr> <td>India</td> <td>3287590</td> <td>0.68</td> <td>1286260000</td> <td>2047811</td> </tr> <tr> <td>Italy</td> <td>301230</td> <td>0.31</td> <td>60676361</td> <td>2147952</td> </tr> <tr> <td>Japan</td> <td>377835</td> <td>0.07</td> <td>126920000</td> <td>4616335</td> </tr> <tr> <td>Russia</td> <td>17098242</td> <td>0.26</td> <td>146544710</td> <td>1857461</td> </tr> <tr> <td>United States</td> <td>9147420</td> <td>0.19</td> <td>323097000</td> <td>17418925</td> </tr> <tr> <td>United Kingdom</td> <td>244820</td> <td>0.18</td> <td>65097000</td> <td>2945146</td> </tr> </tbody> </table> </Table></div>);}}export default App;
npm create vue@latestThis command will install and execute create-vue, the official Vue project scaffolding tool. You will be presented with prompts for several optional features such as TypeScript and testing support:
✔ Project name: …If you are unsure about an option, simply choose No by hitting enter for now. Once the project is created, follow the instructions to install dependencies and start the dev server:✔ Add TypeScript? … No / Yes✔ Add JSX Support? … No / Yes✔ Add Vue Router for Single Page Application development? … No / Yes✔ Add Pinia for state management? … No / Yes✔ Add Vitest for Unit testing? … No / Yes✔ Add an End-to-End Testing Solution? … No / Cypress / Playwright✔ Add ESLint for code quality? … No / Yes✔ Add Prettier for code formatting? … No / YesScaffolding project in ./ ...Done.
cdnpm installnpm install smart-webcomponentsnpm run dev
Make Vue ignore custom elements defined outside of Vue (e.g., using the Web Components APIs). Otherwise, it will throw a warning about an Unknown custom element, assuming that you forgot to register a global component or misspelled a component name.
Open vite.config.js in your favorite text editor and change its contents to the following:import { fileURLToPath, URL } from 'node:url'import { defineConfig } from 'vite'import vue from '@vitejs/plugin-vue'// https://vitejs.dev/config/export default defineConfig({ plugins: [ vue({ template: { compilerOptions: { isCustomElement: tag => tag.startsWith('smart-') } } }) ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } }})
<template> <div class="vue-root"> <div class="demo-description"> Our Table web component can be used to wrap or replace standard Tables and add different styles, hover effects, sorting by one or multiple columns, add, remove and update rows. </div> <smart-table id="table"> <table> <thead> <tr> <th scope="col">Country</th> <th scope="col">Area</th> <th scope="col">Population_Rural</th> <th scope="col">Population_Total</th> <th scope="col">GDP_Total</th> </tr> </thead> <tbody> <tr> <td>Brazil</td> <td>8515767</td> <td>0.15</td> <td>205809000</td> <td>2353025</td> </tr> <tr> <td>China</td> <td>9388211</td> <td>0.46</td> <td>1375530000</td> <td>10380380</td> </tr> <tr> <td>France</td> <td>675417</td> <td>0.21</td> <td>64529000</td> <td>2846889</td> </tr> <tr> <td>Germany</td> <td>357021</td> <td>0.25</td> <td>81459000</td> <td>3859547</td> </tr> <tr> <td>India</td> <td>3287590</td> <td>0.68</td> <td>1286260000</td> <td>2047811</td> </tr> <tr> <td>Italy</td> <td>301230</td> <td>0.31</td> <td>60676361</td> <td>2147952</td> </tr> <tr> <td>Japan</td> <td>377835</td> <td>0.07</td> <td>126920000</td> <td>4616335</td> </tr> <tr> <td>Russia</td> <td>17098242</td> <td>0.26</td> <td>146544710</td> <td>1857461</td> </tr> <tr> <td>United States</td> <td>9147420</td> <td>0.19</td> <td>323097000</td> <td>17418925</td> </tr> <tr> <td>United Kingdom</td> <td>244820</td> <td>0.18</td> <td>65097000</td> <td>2945146</td> </tr> </tbody> </table> </smart-table> </div></template><script>import { onMounted } from "vue";import "smart-webcomponents/source/styles/smart.default.css";import "smart-webcomponents/source/modules/smart.table.js";export default { name: "app", setup() { onMounted(() => {}); }};</script><style></style>We can now use thesmart-table with Vue 3. Data binding and event handlers will just work right out of the box.
npm run devandopen http://localhost:5173/ in your favorite web browser to see the output below:
npm run buildThis will create a production-ready build of your app in the project's ./dist directory.
Read more about using Smart UI for Vue:https://www.htmlelements.com/docs/vue/.