Get started
Installation
Install the packages, provide a theme and render your first component — a few minutes from an empty Angular app. Each component is its own entry point, so only what you import lands in your bundle.
- 1
Install
Take everything at one version, or only the packages you need.
Every component, one entry point each. Core, themes, tokens and icons come with it. Layouts, filters, kanban, wizard, command palette and more. Logos of well-known brands for the icon component. Flags for the country select, loaded one by one. Line, column, combo, scatter, pie, radar, radial bar, gauge, funnel, waterfall, bullet, candlestick, box plot, range area, gantt, sankey, sunburst, bar list, segmented bar, heatmap, treemap, rank and org charts drawn as SVG, no chart library; SVG / PNG / CSV download. Date, relative time, plural and file size pipes; debounced input, copy, in view and drag scroll directives; validators, filter state, HTTP params, retries and polling. Own encoder in plain TypeScript, no dependencies. Its own package — tectra-ng does not include it. Code editor, diff and highlighted code. Its own package — tectra-ng does not include it. npm install tectra-ng - 2
Provide a theme
Pick a style, a primary colour and a surface — the code follows. Every value can be changed later with tokens.
StyleTectra Soft Edge Paper PrimarySurfaceapp.config.ts import { provideTectra } from '@tectra-ng/core/config'; import { createTectraPreset } from '@tectra-ng/themes'; export const appConfig: ApplicationConfig = { providers: [ provideTectra({ preset: createTectraPreset({ primary: 'blue' }) }), ], }; - 3
Use a component
Import it into a standalone component and use it in the template. That is the whole setup.
city-field.ts import { TxSelect } from '@tectra-ng/ui/select'; @Component({ imports: [TxSelect, ReactiveFormsModule], template: `<tx-select [options]="cities" [formControl]="city" placeholder="Pick a city" />`, }) export class CityField { readonly cities = ['Kyiv', 'Lviv', 'Odesa', 'Kharkiv']; readonly city = new FormControl<string | null>(null); }Result Nothing picked yet
Optional
Onest and JetBrains Mono in index.html. Without them the system font is used.
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Onest:wght@100..900&family=JetBrains+Mono:wght@400;500&display=swap"
/>Start in a mode, then switch at runtime — every component follows.
provideTectra({ preset: Tectra, mode: 'dark' });
inject(TxThemeService).toggleMode();Built-in English and Ukrainian texts; switch or add your own.
provideTectra({ preset: Tectra, locale: 'ua' });
inject(TxLocaleService).setLocale('us');Register them once; they load only when shown.
import { provideTxBrandIcons } from '@tectra-ng/brand-icons';
import { loadTxFlag } from '@tectra-ng/flags';
import { provideTxFlags, txFlagImages } from '@tectra-ng/ui/country';
providers: [
provideTxBrandIcons(),
provideTxFlags(txFlagImages(loadTxFlag)),
];Install it next to the kit and import the component.
import { TxEditor } from '@tectra-ng/editor';
@Component({
imports: [TxEditor],
template: `<tx-editor [(html)]="text" height="320px" />`,
})
export class NoteField {
readonly text = signal('<p>Hello</p>');
}Install it next to the kit; it works with forms and renders highlighted code on the server.
import { TxCodeEditor } from '@tectra-ng/code-editor';
@Component({
imports: [TxCodeEditor, ReactiveFormsModule],
template: `<tx-code-editor language="html" [formControl]="markup" height="400px" />`,
})
export class TemplateField {
readonly markup = new FormControl('<h1>Hello</h1>');
}One place for the defaults of every component: ripple, overlay insets, form messages, extra classes.
provideTectra({
preset: Tectra,
ripple: true,
overlay: { viewportInsets: { top: 64 } },
validationMessages: { required: 'Fill this in' },
pt: { button: { root: { class: 'app-button' } } },
});