Skip to content
Logo LogoDuck Framework
Explore the Main Site
⌘ K
Logo LogoDuck Framework
Explore the Main Site

Getting Started

  • Getting Started
  • Project Structure
  • Settings Configuration
  • Build a Reactive Chat App in 5 Minutes
  • Simple Counter App
  • Micro Applications

Command Line Interface

  • Duck Sync

Core Concepts

  • Templates
  • Template Tags & Filters
  • Lively UI
  • Blueprints
  • Duck Shortcuts
  • Duck Utilities

Reactivity & Real-Time

  • WebSockets Support
  • Socket I/O (xsocket)
  • Cached Views
  • Component Caching Utilities
  • Background Thread & Asyncio Loop Managers
  • Task Automations

Networking & Protocols

  • Web Server Gateway (WSGI)
  • Asynchronous Server Gateway (ASGI)
  • HTTP/2 and HTTPS
  • Free SSL Certificate

Request Handling & Auth

  • Request & Response
  • Duck Middlewares
  • Authentication
  • JWT in Duck
  • Sessions in Duck

Data Layer & Integrations

  • Database
  • Django Integration
  • Duck MCP (Model Context Protocol) Support
  • Sitemap

Deployment & Operations

  • Deployment Guide
  • Duck System Monitor
  • Duck Dashboard
  • Duck Service Management
  • Duck Logging System

Reference

  • AI Agent Guidelines
    • Agents.md
    • General Code Style Guide
    • Duck Project Guide
    • HTML Components Guide
    • Security Guide
  • Changelog

API Documentation

  • API Reference
    • duck
Duck Framework
/
API Reference
/
duck
/
duck.html
/
duck.html.components
/
duck.html.components.link

duck.html.components.link¶

Link component module.

Module Contents¶

Classes¶

Link

Link component.

API¶

class duck.html.components.link.Link(url: str = None, text: str = None, *args, **kwargs)[source]¶

Bases: duck.html.components.InnerComponent

Link component.

Parameters:
  • url – The link’s URL.

  • text – Text for the link.

Initialization

Initialize an HTML component.

Parameters:
  • element – The HTML element tag name (e.g., textarea, input, button). Can be None, but make sure element is returned by get_element method.

  • accept_inner_html – Whether the HTML component accepts an inner body (e.g., inner-body-here).

  • inner_html – Inner html to add to the HTML component. Defaults to None.

  • properties – Dictionary for properties to initialize the component with.

  • props – Just same as properties argument (added for simplicity).

  • style – Dictionary for style to initialize the component with.

  • event_handlers – Events to automatically bind. Each dictionary maps an event name to its handler and may include additional keyword arguments forwarded to bind(), e.g. event_handlers=[{"click": on_button_click, **extra_kwargs}].

  • **kwargs – Extra keyword arguments

Raises:

HtmlComponentError – If ‘element’ is not a string or ‘inner_html’ is set but ‘accept_inner_html’ is False.

get_element()[source]¶
on_create()[source]¶
duck.html.components.label
duck.html.components.lively

On this page

  • Module Contents
    • Classes
    • API
      • Link
        • Link.get_element()
        • Link.on_create()

© 2026, Duck Framework Built with Sphinx 8.2.3