Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Y

yii2-widgets

> 编程语言
Open source

Collection of useful widgets for Yii Framework 2.0

558 stars0 likes2 views
WebsiteGitHub

About

Collection of useful widgets for Yii Framework 2.0

yii2-widgets This extension enhances or adds functionality to existing Yii Framework 2 Widgets to make available other bundled features available in Bootstrap 3.0, new HTML 5 features and affiliated Bootstrap extras.

NOTE: This extension has been revamped with release v3.4.1 on 05-Dec-2015. With release v3.4.0, each widget within this extension bundle has been logically regrouped and split into separate sub repositories. This change has been done to allow developers flexibility to install separately or specific widgets only (via composer) if needed. However, for new users installing this bundle should be the easiest way to give you access to all these important widget sub repositories in one shot. This change would not affect backward compatibility for any users already using the previous extension versions.

Widgets available in this bundle

The yii2-widgets bundle automatically includes extensions or widgets from these sub repositories for accessing via \kartik\widgets\ namespace.

  • yii2-krajee-base
  • yii2-widget-activeform
  • yii2-widget-affix
  • yii2-widget-alert
  • yii2-widget-colorinput
  • yii2-widget-datepicker
  • yii2-widget-datetimepicker
  • yii2-widget-depdrop
  • yii2-widget-fileinput
  • yii2-widget-growl
  • yii2-widget-rangeinput
  • yii2-widget-rating
  • yii2-widget-select2
  • yii2-widget-sidenav
  • yii2-widget-spinner
  • yii2-widget-switchinput
  • yii2-widget-timepicker
  • yii2-widget-touchspin
  • yii2-widget-typeahead

Additional related widgets

This extension has now matured to contain the most needed basic widgets for Yii 2 input and navigation controls. In order to support this extension better, any additional input and navigation widgets will be created separately. Listed below are the additional widgets that are related to similar functionality like the yii2-widgets, but have been created as separate extensions (these widgets depend on kartik-v/yii2-widgets).

  • yii2-dropdown-x: Extended Bootstrap 3 dropdown menu for Yii 2.0
  • yii2-nav-x: Extended Bootstrap 3 navigation menu for Yii 2.0
  • yii2-context-menu: Bootstrap 3 context menu for Yii 2.0
  • yii2-slider: Bootstrap 3 Slider control for Yii 2.0
  • yii2-sortable: Create sortable lists and grids using simple drag and drop.
  • yii2-sortable-input: Input widget for yii2-sortable allowing you to store the sort order.
  • yii2-money: Masked money input widget for Yii 2.0.
  • yii2-checkbox-x: Bootstrap 3 extended checkbox widget with 3 states and more styles for Yii 2.0.
  • yii2-date-range: An extended bootstrap 3 date range picker widget for Yii 2.0.
  • yii2-editable: Convert any displayed content to editable using inputs, widgets, and more features for Yii 2.0.
  • yii2-label-inplace: A form enhancement widget for Yii framework 2.0 allowing in-field label support.

Installation

The preferred way to install this extension is through composer. Remember to refer to the composer.json for this extension's requirements and dependencies.

Pre-requisites

Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Install

Either run

$ php composer.phar require kartik-v/yii2-widgets "*"

or add

"kartik-v/yii2-widgets": "*"

to the require section of your composer.json file.

Release Updates

Refer the CHANGE LOG for details on changes to various releases.

The widgets currently available in yii2-widgets are grouped by the type of usage.

Forms/Inputs

ActiveForm

VIEW DEMO

Extends Yii ActiveForm widget. Facilitates all three form layouts available in Bootstrap i.e. vertical, horizontal, and inline. Allows options for offsetting labels and inputs for horizontal form layout. Works closely with the extended ActiveField widget.

ActiveField

VIEW DEMO

Extends Yii ActiveField widget. Allows Bootstrap styled input group addons to be prepended or appended to textInputs. Automatically adjusts checkboxes and radio input offsets for horizontal forms. Allows, flexibility to control the labels and placeholders based on form layout style (e.g. hide labels and show them as placeholder for inline forms). The extended ActiveField functionalities available are:

  • Addons
    • Prepend Addon
    • Append Addon
    • Icon Addon
    • Input Addon
    • Button Addon
    • Button Dropdown Addon
    • Segmented Button Addon
    • Prepend & Append
    • Input Group Settings
  • Inputs
    • Checkbox
    • Radio
    • Checkbox List
    • Radio List
    • Static Input
    • HTML 5 Input
  • Multi Select
    • Vertical Form
    • Horizontal Form
    • Radio List
    • Display Options

DepDrop

VIEW DEMO

The DepDrop widget is a Yii 2 wrapper for the dependent-dropdown jQuery plugin by Krajee. This plugin allows multi level dependent dropdown with nested dependencies. The plugin thus enables to convert normal select inputs to a dependent input field, whose options are derived based on value selected in another input/or a group of inputs. It works both with normal select options and select with optgroups as well.

Select2

VIEW DEMO

The Select2 widget is a Yii 2 wrapper for the Select2 jQuery plugin. This input widget is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results. The widget is specially styled for Bootstrap 3. The widget allows graceful degradation to a normal HTML select or text input, if the browser does not support JQuery.

Typeahead

VIEW DEMO

The Typeahead widget is a Yii 2 wrapper for for the Twitter Typeahead.js plugin with certain custom enhancements. This input widget is a jQuery based replacement for text inputs providing search and typeahead functionality. It is inspired by twitter.com's autocomplete search functionality and based on Twitter's typeahead.js which is described as as a fast and fully-featured autocomplete library. The widget is specially styled for Bootstrap 3. The widget allows graceful degradation to a normal HTML text input, if the browser does not support JQuery. You can setup model validation rules for a model attribute that uses Typeahead widget for input like any other field. The widget comes in two variants:

  • TypeaheadBasic: This widget is a basic implementation of the typeahead.js plugin without any suggestion engine. It uses a javascript substring matcher and Regular Expression matching to query and display suggestions. VIEW DEMO

  • Typeahead: This widget is an advanced implementation of the typeahead.js plugin with the BloodHound suggestion engine and the Handlebars template compiler. VIEW DEMO

DatePicker

VIEW DEMO

The DatePicker widget is a Yii 2 wrapper for the Bootstrap DatePicker plugin. The plugin is a fork of Stefan Petre's DatePicker (of eyecon.ro), with improvements by @eternicode. The widget is specially styled for Yii framework 2.0 and Bootstrap 3 and allows graceful degradation to a normal HTML text input, if the browser does not support JQuery. The widget supports these markups:

  • Simple Input Markup
  • Component Markup - Addon Prepended
  • Component Markup - Addon Appended
  • Inline / Embedded Markup
  • Date Range Markup (from and to dates)

TimePicker

VIEW DEMO

The TimePicker widget allows you to easily select a time for a text input using your mouse or keyboards arrow keys. The widget is a wrapper enhancement of the TimePicker plugin by rendom forked from jdewit's TimePicker. This widget as used here has been specially enhanced for Yii framework 2.0 and Bootstrap 3.

DateTimePicker

VIEW DEMO

The DateTimePicker widget is a Yii 2 wrapper for the Bootstrap DateTimePicker plugin. The plugin is a fork of the DateTimePicker plugin by @eternicode and adds the time functionality. The widget is similar to the DatePicker widget in most aspects, except that it adds the time functionality and does not support ranges. The widget is specially styled for Yii framework 2.0 and Bootstrap 3 and allows graceful degradation to a normal HTML text input, if the browser does not support JQuery. The widget supports these markups:

  • Simple Input Markup
  • Component Markup - Addon Prepended
  • Component Markup - Addon Appended
  • Inline / Embedded Markup

TouchSpin

VIEW DEMO

The TouchSpin widget is a Yii 2 wrapper for for the bootstrap-touchspin plugin by István Ujj-Mészáros, with certain additional enhancements. This input widget is a mobile and touch friendly input spinner component for Bootstrap 3. You can use the widget buttons to rapidly increase and decrease numeric and/or decimal values in your input field. The widget can be setup to include model validation rules for the related model attribute.

FileInput

VIEW DEMO

The FileInput widget is a customized file input widget based on Krajee's Bootstrap FileInput JQuery Plugin. The widget enhances the default HTML file input with various features includi

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHP

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言