# Secure-UI > Zero-dependency, security-first Web Components for HTML forms. Built-in XSS protection, CSRF defence, behavioral bot detection, PCI-compliant payment input, and audit logging — active by default on every component. Works with any server framework, template engine, or plain HTML. Secure-UI is a TypeScript library published to npm as `secure-ui-components`. Each component is a native Custom Element (Web Component) with a closed Shadow DOM, CSP-safe adopted stylesheets, and zero runtime dependencies. Security tier is declared per-field; the library enforces the corresponding protections automatically. ## Components - [secure-input](https://secure-ui-web.fly.dev/documentation/secure-input): Secure text input with XSS sanitisation, rate limiting, paste detection, and four security tiers (public / authenticated / sensitive / critical). Audit log available via `getAuditLog()`. - [secure-select](https://secure-ui-web.fly.dev/documentation/secure-select): Secure dropdown with server-side allowlist validation, security tiers, and audit logging. Prevents client-side option injection. - [secure-textarea](https://secure-ui-web.fly.dev/documentation/secure-textarea): Secure multi-line input with HTML sanitisation, configurable character limits, rate limiting, and security tiers. - [secure-form](https://secure-ui-web.fly.dev/documentation/secure-form): Form orchestrator with built-in CSRF token injection, JSON submission, behavioral telemetry collection, and progressive enhancement fallback. - [secure-file-upload](https://secure-ui-web.fly.dev/documentation/secure-file-upload): File upload with MIME type validation, size limits, drag-and-drop, preview generation, and virus scan hook support. - [secure-datetime](https://secure-ui-web.fly.dev/documentation/secure-datetime): Date/time picker with range validation, timezone handling, and audit logging. - [secure-table](https://secure-ui-web.fly.dev/documentation/secure-table): Data table with client-side sorting, column filtering, and per-column security tier display rules. Supports slotted HTML or programmatic data binding. - [secure-card](https://secure-ui-web.fly.dev/documentation/secure-card): PCI-compliant payment card input with Luhn validation, card type detection (Visa, Mastercard, Amex, Discover), PAN masking on blur, and CVC protection. Full PAN and CVC are never exposed in DOM events, hidden inputs, or audit logs — only `last4` and `cardType` are shared. - [secure-telemetry-provider](https://secure-ui-web.fly.dev/documentation/secure-telemetry-provider): Behavioral intelligence provider. Captures keystroke timing, dwell time, paste detection, autofill signals, and typing velocity. Signs the telemetry payload with HMAC-SHA256 (CryptoKey cached per session). Accumulates threat signals from all child components. Risk scoring flags bot-like or scripted interactions without tracking users. - [secure-password-confirm](https://secure-ui-web.fly.dev/documentation/secure-password-confirm): Dual-field password entry with real-time match validation, strength enforcement, show/hide toggle, injection detection on both fields, and a `secure-threat-detected` event. Security tier locked to critical. Raw password never exposed in events — retrieve via `getPasswordValue()` only. ## Security Model - **Security tiers**: public, authenticated, sensitive, critical — declared per field, enforced by the component. - **CSRF**: `secure-form` injects tokens automatically and validates the header on submission. - **XSS**: All output is sanitised; Shadow DOM isolates component internals from the host page. - **Audit logging**: Every component exposes `getAuditLog()` returning timestamped interaction records without capturing raw sensitive values. - **Rate limiting**: Configurable per-component, client-side, with exponential back-off. - **CSP-safe**: No `eval()`, no `innerHTML` with unsanitised input, no inline event handlers. Styles applied via `adoptedStyleSheets`. ## Installation ```bash npm install secure-ui-components ``` ```html ``` ## Live Demos - [Form Demos](https://secure-ui-web.fly.dev/forms): Submittable login, subscription, and payment forms with live server responses and real-time behavioral telemetry panel. - [Component Showcase](https://secure-ui-web.fly.dev/components): Interactive demos of all configurations for every component. - [Registration Demo](https://secure-ui-web.fly.dev/registration): Full registration flow with server-side validation. ## Documentation - [Documentation Index](https://secure-ui-web.fly.dev/documentation): Full API reference for all components — attributes, events, methods, CSS custom properties. - [Angular Security Development Guideline](https://secure-ui-web.fly.dev/documentation/angular-security-guide): OWASP A01–A10 mapped to Angular-specific controls with enforceable ESLint rules, CI gates, CSP/Trusted Types configuration, bypassSecurityTrust* policy, supply chain hardening, and HTTP interceptor security patterns. - [Theming Guide](https://secure-ui-web.fly.dev/theming): CSS custom property system and five built-in theme presets. Override at :root, per-component, or per-instance. - [Telemetry Guide](https://secure-ui-web.fly.dev/telemetry): How behavioral intelligence works — signals captured, risk scoring algorithm, HMAC signing, and privacy guarantees. ## Legal & Privacy - [Cookie Policy](https://secure-ui-web.fly.dev/cookies): Two cookies only — `__Host-session` (HttpOnly, SameSite=Strict, 24h) and `lang` (preference, 1 year). No analytics, no tracking, no third-party cookies. - [MIT License](https://github.com/Barryprender/Secure-UI/blob/main/LICENSE): Open source, free to use. ## Source - [GitHub](https://github.com/Barryprender/Secure-UI): Source code, issues, and contributions. - [npm](https://www.npmjs.com/package/secure-ui-components): Package registry. - [Sitemap](https://secure-ui-web.fly.dev/sitemap.xml): All public URLs.