Kivy Cupertino

_images/showcase.gif _images/mail_app.png

Kivy Cupertino is a collection of iOS style widgets following Apple’s Human Interface guidelines to be used with the Kivy cross-platform graphical framework without sacrificing ease of use or application performance.

Warning

We are currently in beta status; most widgets have been implemented but stability is not guaranteed. We don’t recommend using Kivy Cupertino in production.

Installation

To install Kivy Cupertino from PyPi, use pip:

$ pip install kivycupertino

To use newly implemented widgets that have not yet been published to PyPI, install from GitHub (not recommended for production use):

$ pip install git+https://github.com/cmdvmd/kivy-cupertino.git

To install Kivy Cupertino for development use, install with the dev extra:

Bar

Bars are generally positioned at the top or bottom of a screen and contain widgets and/or information for easy access by users

class kivycupertino.uix.bar.CupertinoNavigationBar(*args: Any, **kwargs: Any)

iOS style Navigation Bar. CupertinoNavigationBar is a RelativeLayout and can accept any number of widgets

_images/demo.png
color = [0.95, 0.95, 0.95, 1]

Background color of CupertinoNavigationBar

_images/color.png

Python

CupertinoNavigationBar(color=(0.5, 0, 0, 1))

KV

CupertinoNavigationBar:
    color: 0.5, 0, 0, 1
class kivycupertino.uix.bar.CupertinoTab(*args: Any, **kwargs: Any)

iOS style tab to be used with CupertinoTabBar

_images/demo1.png
color_selected = [0.2, 0.45, 1, 1]

Color of the selected tab of CupertinoTab

_images/color_selected.png

Python

CupertinoTabBar(color_selected=(1, 0, 0, 1))

KV

CupertinoTab:
    color_selected: 1, 0, 0, 1
color_unselected = [0.7, 0.7, 0.75, 1]

Color of CupertinoTabBar when not selected

_images/color_unselected.png

Python

CupertinoTab(color_unselected=(0.5, 0, 0, 1))

KV

CupertinoTab:
    color_unselected: 0.5, 0, 0, 1
symbol = ' '

Symbol of CupertinoTab

_images/symbol.png

Python

CupertinoTab(symbol='hammer_fill')

KV

CupertinoTab:
    symbol: 'hammer_fill'
text = ' '

Text of CupertinoTab

_images/text.png

Python

CupertinoTab(text='Tab')

KV

CupertinoTab:
    text: 'Tab'
class kivycupertino.uix.bar.CupertinoTabBar(*args: Any, **kwargs: Any)

iOS style tab bar

_images/demo.gif
add_widget(widget, index=0, canvas=None)

Add an instance of CupertinoTab to CupertinoTabBar

background_color = [0.95, 0.95, 0.95, 1]

Background color of CupertinoTabBar when selected

_images/background_color.png

Python

CupertinoTabBar(background_color=(0.5, 0, 0, 1))

KV

CupertinoTabBar:
    background_color: 0.5, 0, 0, 1
get_selected_tab()

Get the currently selected tab of CupertinoTabBar

Returns

The selected CupertinoTab

class kivycupertino.uix.bar.CupertinoToolbar(*args: Any, **kwargs: Any)

iOS style Toolbar. CupertinoToolbar is a RelativeLayout and can accept any number of widgets

_images/demo2.png
color = [0.95, 0.95, 0.95, 1]

Background color of CupertinoToolbar

_images/color1.png

Python

CupertinoToolbar(color=(0.5, 0, 0, 1))

KV

CupertinoToolbar:
    color: 0.5, 0, 0, 1

Behavior

Behaviors allow for expanded functionality for existing widgets

Note

Behaviors can only be used as superclasses for instances of Widget

class kivycupertino.uix.behavior.CupertinoButtonBehavior(*args: Any, **kwargs: Any)

Base class for buttons that can only be used with an instance of kivy.uix.widget.Widget

color

Current color of a widget with CupertinoButtonBehavior

color_disabled

Color of widget with CupertinoButtonBehavior when disabled

_images/color_disabled.png

Python

CupertinoButton(disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoButton:
    disabled: True
    color_disabled: 0.5, 0, 0, 1
color_down

Color of widget with CupertinoButtonBehavior when pressed

_images/color_down.gif

Python

CupertinoButton(color_down=(1, 0, 0, 1))

KV

CupertinoButton:
    color_down: 1, 0, 0, 1
color_normal

Color of widget with CupertinoButtonBehavior when not pressed or disabled

_images/color_normal.png

Python

CupertinoButton(color_normal=(1, 0, 0, 1))

KV

CupertinoButton:
    color_normal: 1, 0, 0, 1
disabled

If widget with CupertinoButtonBehavior is disabled

_images/disabled.png

Python

CupertinoButton(disabled=True)

KV

CupertinoButton:
    disabled: True
transition_duration = 0.075

Duration of the transition of the color of widget with CupertinoButtonBehavior when its state changes

_images/transition_duration.gif

Python

CupertinoButton(transition_duration=0.5)

KV

CupertinoButton:
    transition_duration: 0.5
class kivycupertino.uix.behavior.LongPressBehavior(**kwargs)

Behavior to detect a long press on a widget

_images/demo1.gif
long_press_duration = 1

Time that constitutes a long press

_images/long_press_duration.gif

Python

ExampleWidget(long_press_duration=2)

KV

ExampleWidget:
    long_press_duration: 2
on_long_press(touch)

Event when a widget is long pressed

Parameters

touch – The touch on this widget

class kivycupertino.uix.behavior.SelectableBehavior(**kwargs)

Behavior to detect a selection of a specific widget among all other widgets in parent

_images/demo2.gif
on_chosen()

Event when a widget is selected

on_selected(instance, value)

Callback when selected of a widget with SelectableBehavior is changed

Parameters
refresh()

Set selected of this instance of SelectableBehavior to True while setting all other instances in parent to False

Note

This function is mainly to be used when adding widgets to a parent. Otherwise, setting selected to True will achieve this

selected = False

If a widget is selected in its parent

_images/selected.png

Python

ExampleWidget(selected=True)

KV

ExampleWidget:
    selected: True

Button

Buttons allow users to execute actions with a single tap

class kivycupertino.uix.button.CupertinoButton(*args: Any, **kwargs: Any)

iOS style button

_images/demo3.gif
color_disabled = [0, 0.35, 0.7, 1]

Background color of CupertinoButton when disabled

_images/color_disabled.png

Python

CupertinoButton(disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoButton:
    disabled: True
    color_disabled: 0.5, 0, 0, 1
color_down = [0, 0.15, 0.8, 1]

Background color of CupertinoButton when pressed

_images/color_down.gif

Python

CupertinoButton(color_down=(1, 0, 0, 1))

KV

CupertinoButton:
    color_down: 1, 0, 0, 1
color_normal = [0, 0.5, 1, 1]

Color of CupertinoButton when not pressed or disabled

_images/color_normal.png

Python

CupertinoButton(color_normal=(1, 0, 0, 1))

KV

CupertinoButton:
    color_normal: 1, 0, 0, 1
disabled = False

If CupertinoButton is disabled

_images/disabled.png

Python

CupertinoButton(disabled=True)

KV

CupertinoButton:
    disabled: True
font_size = '17sp'

text of CupertinoButton

_images/font_size.png

Python

CupertinoButton(font_size='20sp')

KV

CupertinoButton:
    font_size: '20sp'
text = ' '

Text of CupertinoButton

_images/text1.png

Python

CupertinoButton(text='Hello World')

KV

CupertinoButton:
    text: 'Hello World'
text_color = [1, 1, 1, 1]

A ColorProperty defining the color of text of CupertinoButton

_images/text_color.png

Python

CupertinoButton(text_color=(1, 0, 0, 1))

KV

CupertinoButton:
    color_disabled: 1, 0, 0, 1
transition_duration = 0.075

Duration of the transition of the color of CupertinoButton when its state changes

_images/transition_duration.gif

Python

CupertinoButton(transition_duration=0.5)

KV

CupertinoButton:
    transition_duration: 0.5
class kivycupertino.uix.button.CupertinoSymbolButton(*args: Any, **kwargs: Any)

iOS style button that displays a symbol

_images/demo4.gif
color_disabled = [0, 0, 0, 0.7]

Color of CupertinoSymbolButton when disabled

_images/color_disabled1.png

Python

CupertinoSymbolButton(color_disabled=(0.5, 0, 0, 1))

KV

CupertinoSymbolButton:
    color_disabled: 0.5, 0, 0, 1
color_down = [0, 0, 0, 0.7]

Color of CupertinoSymbolButton when pressed

_images/color_down1.gif

Python

CupertinoSymbolButton(color_down=(1, 0, 0, 1))

KV

CupertinoSymbolButton:
    color_down: 1, 0, 0, 1
color_normal = [0, 0, 0, 1]

Color of CupertinoSymbolButton when not pressed or disabled

_images/color_normal1.png

Python

CupertinoSymbolButton(color_normal=(1, 0, 0, 1))

KV

CupertinoSymbolButton:
    color_normal: 1, 0, 0, 1
disabled = False

If CupertinoSymbolButton is disabled

_images/disabled1.png

Python

CupertinoSymbolButton(disabled=True)

KV

CupertinoSymbolButton:
    disabled: True
symbol = ' '

Symbol of CupertinoSymbolButton

_images/symbol1.png

Python

CupertinoSymbolButton(symbol='wifi')

KV

CupertinoSymbolButton:
    symbol: 'wifi'
transition_duration = 0.075

Duration of the transition of the color of CupertinoSymbolButton when its state changes

_images/transition_duration1.gif

Python

CupertinoSymbolButton(transition_duration=0.5)

KV

CupertinoSymbolButton:
    transition_duration: 0.5
class kivycupertino.uix.button.CupertinoSystemButton(*args: Any, **kwargs: Any)

iOS style System Button

_images/demo5.gif
color_disabled = [0, 0.3, 0.4, 1]

Color of CupertinoSystemButton when disabled

_images/color_disabled2.png

Python

CupertinoSystemButton(disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoSystemButton:
    disabled: True
    color_disabled: 0.5, 0, 0, 1
color_down = [0, 0.15, 0.3, 1]

Color of CupertinoSystemButton when pressed

_images/color_down2.gif

Python

CupertinoSystemButton(color_down=(1, 0, 0, 1))

KV

CupertinoSystemButton:
    color_down: 1, 0, 0, 1
color_normal = [0.05, 0.5, 0.95, 1]

Color of CupertinoSystemButton when not pressed or disabled

_images/color_normal2.png

Python

CupertinoSystemButton(color_normal=(1, 0, 0, 1))

KV

CupertinoSystemButton:
    color_normal: 1, 0, 0, 1
disabled = False

If CupertinoSystemButton is disabled

_images/disabled2.png

Python

CupertinoSystemButton(disabled=True)

KV

CupertinoSystemButton:
    disabled: True
font_size = '15sp'

Font size of the text of CupertinoSystemButton

_images/font_size1.png

Python

CupertinoSystemButton(font_size='20sp')

KV

CupertinoSystemButton:
    font_size: '20sp'
text = ' '

Text of CupertinoSystemButton

_images/text2.png

Python

CupertinoSystemButton(text='Send')

KV

CupertinoSystemButton:
    text: 'Send'
transition_duration = 0.075

Duration of the transition of the color of CupertinoSystemButton when its state changes

_images/transition_duration2.gif

Python

CupertinoSystemButton(transition_duration=0.5)

KV

CupertinoSystemButton:
    transition_duration: 0.5

Control

Controls allow users to control information on their screen

class kivycupertino.uix.control.CupertinoSegment(*args: Any, **kwargs: Any)

iOS style segment to be used with CupertinoSegmentedControls

color = [0, 0, 0, 1]

Color of text of CupertinoSegment

_images/color2.png

Python

CupertinoSegment(color=(1, 0, 0, 1))

KV

CupertinoSegment:
    text_color: 1, 0, 0, 1
class kivycupertino.uix.control.CupertinoSegmentedControls(*args: Any, **kwargs: Any)

iOS style Segmented Controls

_images/demo2.gif
add_widget(widget, index=0, canvas=None)

Add an instance of CupertinoSegment to CupertinoSegmentedControls

background_color = [0.9, 0.9, 0.9, 0.75]

Background color of CupertinoSegmentedControls

_images/background_color1.png

Python

CupertinoSegmentedControls(background_color=(0.5, 0, 0, 1))

KV

CupertinoSegmentedControls:
    background_color: 0.5, 0, 0, 1
color_selected = [1, 1, 1, 1]

Background color of selected tab of CupertinoSegmentedControls

_images/color_selected1.png

Python

CupertinoSegmentedControls(color_selected=(1, 0, 0, 1))

KV

CupertinoSegmentedControls:
    color_selected: 1, 0, 0, 1
get_selected_segment()

Get the currently selected segment of CupertinoSegmentedControls

Returns

The selected CupertinoSegment

on_touch_move(touch)

Detect a movement on a segment of CupertinoSegmentedControls

Parameters

touch – Touch on CupertinoSegmentedControls

transition_duration = 0.1

Duration of change of selected segment of CupertinoSegmentedControls

_images/transition_duration3.gif

Python

CupertinoSegmentedControls(transition_duration=0.5)

KV

CupertinoSegmentedControls:
    transition_duration: 0.5
class kivycupertino.uix.control.CupertinoStepper(*args: Any, **kwargs: Any)

iOS style Stepper

_images/demo6.gif
add_disabled = False

If add button of CupertinoStepper is disabled

_images/add_disabled.png

Python

CupertinoStepper(add_disabled=True)

KV

CupertinoStepper:
    add_disabled: True
color_disabled = [0.8, 0.8, 0.8, 1]

Background color of button of CupertinoStepper when disabled

_images/color_disabled3.png

Python

CupertinoStepper(add_disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoStepper:
    add_disabled: True
    color_disabled: 0.5, 0, 0, 1
color_down = [0.7, 0.7, 0.7, 1]

Background color of button of CupertinoStepper when valid

_images/color_down3.gif

Python

CupertinoStepper(color_down=(0.5, 0, 0, 1))

KV

CupertinoStepper:
    color_down: 0.5, 0, 0, 1
color_normal = [0.9, 0.9, 0.9, 0.75]

Background color of button of CupertinoStepper when not valid

_images/color_normal3.png

Python

CupertinoStepper(color_normal=(0.5, 0, 0, 1))

KV

CupertinoStepper:
    color_normal: 0.5, 0, 0, 1
minus_disabled = False

If minus button of CupertinoStepper is disabled

_images/minus_disabled.png

Python

CupertinoStepper(minus_disabled=True)

KV

CupertinoStepper:
    minus_disabled: True
on_minus()

Callback when minus button is valid

on_plus()

Callback when plus button is valid

text_color = [0, 0, 0, 1]

Color of text of button of CupertinoStepper

_images/text_color1.png

Python

CupertinoStepper(text_color=(1, 0, 0, 1))

KV

CupertinoStepper:
    text_color: 1, 0, 0, 1

Indicator

Indicators help show progress to users

class kivycupertino.uix.indicator.CupertinoActivityIndicator(*args: Any, **kwargs: Any)

iOS style activity indicator

_images/demo7.gif
color = [0.6, 0.6, 0.65, 1]

Color of the spokes of CupertinoActivityIndicator

_images/color.gif

Python

CupertinoActivityIndicator(color=(1, 0, 0, 1))

KV

CupertinoActivityIndicator:
    color: 1, 0, 0, 1
duration = 1

Time for one cycle of CupertinoActivityIndicator (in seconds)

_images/duration.gif

Python

CupertinoActivityIndicator(duration=2)

KV

CupertinoActivityIndicator:
    duration: 2
playing = False

Color of the spokes of CupertinoActivityIndicator

Python

CupertinoActivityIndicator(playing=True)

KV

CupertinoActivityIndicator:
    playing: True
spokes = 12

Amount of spokes of CupertinoActivityIndicator

_images/spokes.gif

Python

CupertinoActivityIndicator(spokes=20)

KV

CupertinoActivityIndicator:
    spokes: 20
class kivycupertino.uix.indicator.CupertinoProgressbar(*args: Any, **kwargs: Any)

iOS style Progress Bar

_images/demo8.gif
color_selected = [0, 0.5, 1, 1]

Color of the bar of occurred progress of CupertinoProgressBar

_images/color_selected.gif

Python

CupertinoProgressbar(color_selected=(1, 0, 0, 1))

KV

CupertinoProgressbar:
    color_selected: 1, 0, 0, 1
color_unselected = [0.7, 0.7, 0.7, 1]

Color of the bar of not yet occurred progress of CupertinoProgressBar

_images/color_unselected.gif

Python

CupertinoProgressbar(color_unselected=(0.5, 0, 0, 1))

KV

CupertinoProgressbar:
    color_unselected: 0.5, 0, 0, 1
on_value(instance, value)

Callback when value of CupertinoProgressbar

Parameters
value = 0

Amount of progress occurred in interval [0, 1] of CupertinoProgressbar

_images/value.png

Python

CupertinoProgressbar(value=50)

KV

CupertinoProgressbar:
    value: 50

Label

Labels display text to users

class kivycupertino.uix.label.CupertinoLabel(*args: Any, **kwargs: Any)

iOS style Label

_images/demo3.png
bold = False

If text CupertinoLabel is bold

_images/bold.png

Python

CupertinoLabel(bold=True)

KV

CupertinoLabel:
    bold: True
color = [0, 0, 0, 1]

Color of text CupertinoLabel

_images/color3.png

Python

CupertinoLabel(color=(1, 0, 0, 1))

KV

CupertinoLabel:
    color: 1, 0, 0, 1
font_name = 'San Francisco'

Font of CupertinoLabel. To comply with iOS standard, use San Francisco or New York

_images/font_name.png

Python

CupertinoLabel(font_name='New York')

KV

CupertinoLabel:
    font_name: 'New York'
font_size = '15sp'

Size of the font of CupertinoLabel

_images/font_size2.png

Python

CupertinoLabel(font_size='20sp')

KV

CupertinoLabel:
    font_size: '20sp'
italic = False

If text of CupertinoLabel is italic

_images/italic.png

Python

CupertinoLabel(italic=True)

KV

CupertinoLabel:
    italic: True
text = ' '

A StringProperty defining the text of CupertinoLabel

_images/text3.png

Python

CupertinoLabel(text='Hello World')

KV

CupertinoLabel:
    text: 'Hello World'

Modal

Modals help alert users to information

class kivycupertino.uix.modal.CupertinoActionSheet(*args: Any, **kwargs: Any)

iOS style Action Sheet

_images/demo9.gif
action_height

Height of CupertinoModalButton when added to CupertinoActionSheet

_images/action_height.png

Python

CupertinoActionSheet(action_height=75)

KV

CupertinoActionSheet:
    action_height: 75
color_normal = [1, 1, 1, 0.9]

Background color of message frame of CupertinoActionSheet

_images/color_normal4.png

Python

CupertinoActionSheet(color_normal=(0.5, 0, 0, 1))

KV

CupertinoActionSheet:
    color_normal: 0.5, 0, 0, 1
curve

Curve of CupertinoActionSheet

_images/curve.png

Python

CupertinoActionSheet(curve=20)

KV

CupertinoActionSheet:
    curve: 20
message = ' '

Message shown in message frame of CupertinoActionSheet

_images/message.png

Python

CupertinoActionSheet(message='Hello World')

KV

CupertinoActionSheet:
    message: 'Hello World'
spacing

Spacing between children of CupertinoActionSheet

_images/spacing.png

Python

CupertinoActionSheet(spacing=5)

KV

CupertinoActionSheet:
    spacing: 5
text_color = [0.6, 0.6, 0.6, 1]

Color of title and message shown in message frame of CupertinoActionSheet

_images/text_color2.png

Python

CupertinoActionSheet(text_color=[1, 0, 0, 1])

KV

CupertinoActionSheet:
    text_color: 1, 0, 0, 1
title = ' '

Title shown in message frame of CupertinoActionSheet

_images/title.png

Python

CupertinoActionSheet(title='Hello World')

KV

CupertinoActionSheet:
    title: 'Hello World'
class kivycupertino.uix.modal.CupertinoDialog(*args: Any, **kwargs: Any)

iOS style dialog that dynamically adapts to the amount of actions (CupertinoModalButton) it has

_images/demo10.gif
action_height

Height of CupertinoModalButton when added to CupertinoDialog

_images/action_height1.png

Python

CupertinoDialog(action_height=75)

KV

CupertinoDialog:
    action_height: 75
color = [1, 1, 1, 0.9]

Background color of CupertinoDialog

_images/color4.png

Python

CupertinoDialog(color=(1, 0, 0, 1))

KV

CupertinoDialog:
    color: 1, 0, 0, 1
curve

Curve of CupertinoDialog

_images/curve1.png

Python

CupertinoDialog(curve=20)

KV

CupertinoDialog:
    curve: 20
spacing

Spacing between children of CupertinoDialog

_images/spacing1.png

Python

CupertinoDialog(spacing=5)

KV

CupertinoDialog:
    spacing: 5
class kivycupertino.uix.modal.CupertinoModalButton(*args: Any, **kwargs: Any)

Adaptive button to be used in Dialogs

_images/demo11.gif
cancel = False

If CupertinoModalButton should be a cancel button when added to an instance of CupertinoActionSheet

_images/cancel.png

Python

CupertinoModalButton(cancel=True)

KV

CupertinoModalButton:
    cancel: True
color_disabled = [0.8, 0.8, 0.8, 1]

Background color of CupertinoModalButton when disabled

_images/color_disabled4.png

Python

CupertinoModalButton(disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoModalButton:
    disabled: True
    color_disabled: 0.5, 0, 0, 1
color_down = [0.9, 0.9, 0.9, 0.9]

Background color of CupertinoModalButton when pressed

_images/color_down4.gif

Python

CupertinoModalButton(color_down=(0.5, 0, 0, 1))

KV

CupertinoModalButton:
    color_down: 0.5, 0, 0, 1
color_normal = [1, 1, 1, 0.9]

Background color of CupertinoModalButton when not pressed

_images/color_normal5.png

Python

CupertinoModalButton(color_normal=(0.5, 0, 0, 1))

KV

CupertinoModalButton:
    color_normal: 0.5, 0, 0, 1
disabled = False

If CupertinoModalButton is disabled

_images/disabled3.png

Python

CupertinoModalButton(disabled=True)

KV

CupertinoModalButton:
    disabled: True
font_size = '14sp'

Size of text of CupertinoModalButton

_images/font_size3.png

Python

CupertinoModalButton(font_size='20sp')

KV

CupertinoModalButton:
    font_size: '20sp'
text = ' '

Text of CupertinoModalButton

_images/text4.png

Python

CupertinoModalButton(text='Hello World')

KV

CupertinoModalButton:
    text: 'Hello World'
text_color = [0.05, 0.5, 1, 1]

Color of the text of CupertinoModalButton

_images/text_color3.png

Python

CupertinoModalButton(text_color=(1, 0, 0, 1))

KV

CupertinoModalButton:
    text_color: 1, 0, 0, 1
transition_duration = 0.075

Duration of the transition of the color of CupertinoButton when its state changes

_images/transition_duration4.gif

Python

CupertinoModalButton(transition_duration=0.5)

KV

CupertinoModalButton:
    transition_duration: 0.5

Page

Pages allow for a separation of different features

class kivycupertino.uix.page.CupertinoPageControls(*args: Any, **kwargs: Any)

iOS style Page Controls. Will automatically update the number of pages and current page when added to an instance of CupertinoScreenManager

_images/demo12.gif
background_color = [0, 0, 0, 0]

Background color of CupertinoPageControls

_images/background_color2.png

Python

CupertinoPageControls(background_color=(1, 0, 0, 1))

KV

CupertinoPageControls:
    background_color: 1, 0, 0, 1
color_selected = [1, 1, 1, 1]

A ColorProperty defining the color of a dot on CupertinoPageControls when not selected

_images/color_selected1.gif

Python

CupertinoPageControls(color_selected=(1, 0, 0, 1))

KV

CupertinoPageControls:
    color_selected: 1, 0, 0, 1
color_unselected = [0.2, 0.2, 0.2, 1]

Color of a dot on CupertinoPageControls when not selected

_images/color_unselected1.gif

Python

CupertinoPageControls(color_unselected=(0.5, 0, 0, 1))

KV

CupertinoPageControls:
    color_unselected: 0.5, 0, 0, 1
on_parent(instance, parent)

Callback when CupertinoPageControls is added to CupertinoScreenManager

Parameters
tap = False

If tapping CupertinoPageControls will switch to a screen

_images/tap.gif

Python

CupertinoPageControls(tap=True)

KV

CupertinoPageControls:
    tap: True
class kivycupertino.uix.page.CupertinoScreenManager(*args: Any, **kwargs: Any)

A Screen Manager widget that also accepts an instance of CupertinoPageControls

add_widget(widget, *args, **kwargs)

Callback when a Screen or a CupertinoPageControls is added to CupertinoScreenManager

Parameters

widget – Widget to be added to CupertinoScreenManager

Scrollview

ScrollViews help show lots of information within a set screen size

class kivycupertino.uix.scrollview.CupertinoScrollView(*args: Any, **kwargs: Any)

iOS style ScrollView

_images/demo13.gif
bar_color = [0.65, 0.65, 0.65, 1]

Color of the bar of CupertinoScrollView when scrolling

_images/bar_color.gif

Python

CupertinoScrollview(bar_color=(1, 0, 0, 1))

KV

CupertinoScrollview:
    bar_color: 1, 0, 0, 1
bar_inactive_color = [0, 0, 0, 0]

Color of the bar of CupertinoScrollView when not scrolling

_images/bar_inactive_color.gif

Python

CupertinoScrollview(bar_inactive_color=(0.5, 0, 0, 1))

KV

CupertinoScrollview:
    bar_inactive_color: 0.5, 0, 0, 1

Slider

Sliders allow users to choose values

class kivycupertino.uix.slider.CupertinoSlider(*args: Any, **kwargs: Any)

iOS style slider

_images/demo14.gif
color_selected = [0, 0.5, 1, 1]

Color of the bar of occurred progress of CupertinoSlider

_images/color_selected2.gif

Python

CupertinoSlider(color_selected=(1, 0, 0, 1))

KV

CupertinoSlider:
    color_selected: 1, 0, 0, 1
color_unselected = [0.7, 0.7, 0.7, 1]

Color of bar of not yet occurred progress of CupertinoSlider

_images/color_unselected2.gif

Python

CupertinoSlider(color_unselected=(0.5, 0, 0, 1))

KV

CupertinoSlider:
    color_unselected: 0.5, 0, 0, 1
max = 100

Maximum value of CupertinoSlider

Python

CupertinoSlider(max=50)

KV

CupertinoSlider:
    max: 50
min = 0

Minimum value of CupertinoSlider

Python

CupertinoSlider(min=-50)

KV

CupertinoSlider:
    min: -50
on_touch_move(touch)

Callback when CupertinoSlider is dragged

Parameters

touch – Touch on CupertinoSlider

tap = True

If tapping CupertinoSlider can change its value

_images/tap1.gif

Python

CupertinoSlider(tap=True)

KV

CupertinoSlider:
    tap: True
thumb_color = [1, 1, 1, 1]

Color of the thumb of CupertinoSlider

_images/thumb_color.png

Python

CupertinoSlider(thumb_color=(1, 0, 0, 1))

KV

CupertinoSlider:
    thumb_color: 1, 0, 0, 1
value = 0

Value of CupertinoSlider

_images/value1.png

Python

CupertinoSlider(value=50)

KV

CupertinoSlider:
    value: 50

Swipe

Swiping allows users to interact with widgets by using hidden actions

class kivycupertino.uix.swipe.CupertinoSwipe(*args: Any, **kwargs: Any)

A widget to add swiping functionality to existing Kivy Cupertino widgets

_images/demo15.gif
background_color = [1, 1, 1, 1]

Background color of CupertinoSwipe

_images/background_color3.png

Python

CupertinoSwipe(background_color=(1, 0, 0, 1))

KV

CupertinoSwipe:
    background_color: 1, 0, 0, 1
collapse()

Callback to reset CupertinoSwipe so no actions are visible

_images/collapse.gif
complete_swipe_duration = 0.5

How long after CupertinoSwipe is released until swipe is moved to final position (completely expanded or completely collapsed)

_images/complete_swipe_duration.gif

Python

CupertinoSwipe(complete_swipe_duration=1)

KV

CupertinoSwipe:
    complete_swipe_duration: 1
expand(side)

Callback to completely open a specified side CupertinoSwipe

_images/expand.gif
Parameters

side – The side of CupertinoSwipe to expand ('left' or 'right')

is_collapsed()

Check if CupertinoSwipe is collapsed

Returns

If CupertinoSwipe is collapsed

class kivycupertino.uix.swipe.CupertinoSwipeAction(*args: Any, **kwargs: Any)

An iOS style action to add to CupertinoSwipe

_images/demo4.png
color_disabled = [0, 0.3, 0.4, 1]

Color of CupertinoSwipeAction when disabled

_images/color_disabled5.png

Python

CupertinoSwipeAction(disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoSwipeAction:
    disabled: True
    color_disabled: 0.5, 0, 0, 1
color_normal = [1, 0, 0, 1]

Color of CupertinoSwipeAction when not pressed or disabled

_images/color_normal6.png

Python

CupertinoSwipeAction(color_normal=(1, 0, 0, 1))

KV

CupertinoSwipeAction:
    color_normal: 1, 0, 0, 1
disabled = False

If CupertinoSwipeAction is disabled

_images/disabled4.png

Python

CupertinoSwipeAction(disabled=True)

KV

CupertinoSwipeAction:
    disabled: True
side = 'left'

Side of CupertinoSwipe that CupertinoSwipeAction should be shown on

_images/side.png

Python

CupertinoSwipeAction(side='right')

KV

CupertinoSwipeAction:
    side: 'right'
symbol = ' '

Text of CupertinoSwipeAction

_images/symbol2.png

Python

CupertinoSwipeAction(symbol='trash_fill')

KV

CupertinoSwipeAction:
    symbol: 'trash_fill'
text = ' '

Text of CupertinoSwipeAction

_images/text5.png

Python

CupertinoSwipeAction(text='Delete')

KV

CupertinoSwipeAction:
    text: 'Delete'
text_color = [1, 1, 1, 1]

Color of text of CupertinoSwipeAction

_images/text_color4.png

Python

CupertinoSwipeAction(text_color=(1, 0, 0, 1))

KV

CupertinoSwipeAction:
    text_color: 1, 0, 0, 1

Switch

Switches allow users to toggle options

class kivycupertino.uix.switch.CupertinoSwitch(*args: Any, **kwargs: Any)

iOS style Switch. To comply with iOS standard, keep the width to height ratio of CupertinoSwitch at 1:0.6

_images/demo16.gif
color_toggled = [0.3, 0.85, 0.4, 1]

Background color of CupertinoSwitch when on

_images/color_toggled.gif

Python

CupertinoSwitch(color_toggled=(1, 0, 0, 1))

KV

CupertinoSwitch:
    color_toggled: 1, 0, 0, 1
color_untoggled = [0.85, 0.85, 0.85, 1]

Background color of CupertinoSwitch when off

_images/color_untoggled.gif

Python

CupertinoSwitch(color_untoggled=(0.5, 0, 0, 1))

KV

CupertinoSwitch:
    color_untoggled: 0.5, 0, 0, 1
on_toggled(instance, state)

Callback when state of CupertinoSwitch is changed

Parameters
on_touch_move(touch)

Callback when CupertinoSwitch is dragged

Parameters

touchMouseMotionEvent detected on CupertinoSwitch

switch_duration = 0.1

Duration of color change and thumb movement when state of CupertinoSwitch is changed

_images/switch_duration.gif

Python

CupertinoSwitch(switch_duration=0.5)

KV

CupertinoSwitch:
    switch_duration: 0.5
thumb_color = [1, 1, 1, 1]

Color of thumb of CupertinoSwitch

_images/thumb_color.gif

Python

CupertinoSwitch(thumb_color=(1, 0, 0, 1))

KV

CupertinoSwitch:
    thumb_color: 1, 0, 0, 1
thumb_padding

Amount of padding around thumb of CupertinoSwitch in interval [0, 1] as a percentage of the height of CupertinoSwitch

_images/thumb_padding.gif

Python

CupertinoSwitch(thumb_padding=0.1)

KV

CupertinoSwitch:
    thumb_padding: 0.1
toggled = False

If CupertinoSwitch is on

_images/toggled.png

Python

CupertinoSwitch(toggled=True)

KV

CupertinoSwitch:
    toggled: True

Symbol

Symbols help portray an action with a simple symbol. To view all symbols in Kivy Cupertino, visit Framework7 or run the Symbols program

class kivycupertino.uix.symbol.CupertinoSymbol(*args: Any, **kwargs: Any)

Display an iOS style symbol.

_images/demo5.png
color = [0, 0, 0, 1]

Color of CupertinoSymbol

_images/color5.png

Python

CupertinoSymbol(color=(1, 0, 0, 1))

KV

CupertinoSymbol:
    color: 1, 0, 0, 1
on_symbol(instance, symbol)

Callback when symbol of CupertinoSymbol is changed

Parameters
  • instance – Instance of CupertinoSymbol

  • symbol – Symbol to be displayed

symbol = ' '

Symbol to be displayed by CupertinoSymbol.

_images/symbol3.png

Python

CupertinoSymbol(symbol='alarm_fill')

KV

CupertinoSymbol:
    symbol: 'alarm_fill'

Table

Tables help organize data and information for users to view and interact with

class kivycupertino.uix.table.CupertinoClickableTableCell(*args: Any, **kwargs: Any)

iOS style clickable Cell for Table View. CupertinoClickableTableCell is a RelativeLayout and can accept any number of widgets

_images/demo17.gif
color_disabled = [0.8, 0.8, 0.8, 1]

Background color of CupertinoClickableTableCell when disabled

_images/color_disabled6.png

Python

CupertinoTableCell(disabled=True, color_disabled=(0.5, 0, 0, 1))

KV

CupertinoClickableTableCell:
    disabled: True
    color_disabled: 0.5, 0, 0, 1
color_down = [0.9, 0.9, 0.9, 0.9]

Background color of CupertinoClickableTableCell when pressed

_images/color_down5.gif

Python

CupertinoClickableTableCell(color_down=(0.5, 0, 0, 1))

KV

CupertinoClickableTableCell:
    color_down: 0.5, 0, 0, 1
color_normal = [1, 1, 1, 1]

Background color of CupertinoClickableTableCell when not pressed or disabled

_images/color_normal7.png

Python

CupertinoClickableTableCell(color_normal=(1, 0, 0, 1))

KV

CupertinoClickableTableCell:
    color_normal: 1, 0, 0, 1
disabled = False

If CupertinoClickableTableCell is disabled

_images/disabled5.png

Python

CupertinoClickableTableCell(disabled=True)

KV

CupertinoClickableTableCell:
    disabled: True
transition_duration = 0.075

Duration of the transition of the color of CupertinoButton when its state changes

_images/transition_duration5.gif

Python

CupertinoClickableTableCell(transition_duration=0.5)

KV

CupertinoClickableTableCell:
    transition_duration: 0.5
class kivycupertino.uix.table.CupertinoTableCell(*args: Any, **kwargs: Any)

iOS style Cell for Table View. CupertinoTableCell is a RelativeLayout and can accept any number of widgets

_images/demo6.png
color = [1, 1, 1, 1]

Background color of CupertinoTableCell

_images/color6.png

Python

CupertinoTableCell(color=(1, 0, 0, 1))

KV

CupertinoNavigationBar:
    CupertinoTableCell: 1, 0, 0, 1
class kivycupertino.uix.table.CupertinoTableGroup(*args: Any, **kwargs: Any)

iOS style table group

_images/demo7.png
add_widget(widget, index=0, canvas=None)

Add an instance of CupertinoTableCell to CupertinoTableGroup

Parameters
text = ' '

Background color of CupertinoClickableTableCell when disabled

_images/text6.png

Python

CupertinoTableGroup(text='Example Group')

KV

CupertinoTableGroup:
    text: 'Example Group'
text_color = [0.6, 0.6, 0.6, 1]

Background color of CupertinoClickableTableCell when disabled

_images/text_color5.png

Python

CupertinoTableGroup(text_color=(1, 0, 0, 1))

KV

CupertinoTableGroup:
    text_color: 1, 0, 0, 1

Textinput

Text fields allow users to enter input

class kivycupertino.uix.textinput.CupertinoSearchBar(*args: Any, **kwargs: Any)

iOS style search bar

_images/demo18.gif
background_color = [0.85, 0.85, 0.85, 0.7]

Background color of CupertinoSearchBar

_images/background_color4.png

Python

CupertinoSearchBar(background_color=(1, 0, 0, 1))

KV

CupertinoSearchBar:
    background_color: 1, 0, 0, 1
color_down = [0.4, 0.4, 0.4, 1]

Color of the clear button of CupertinoSearchBar when pressed

_images/color_down6.gif

Python

CupertinoSearchBar(color_down=(0.5, 0, 0, 1))

KV

CupertinoSearchBar:
    color_down: 0.5, 0, 0, 1
cursor_color = [0.25, 0.5, 0.95, 1]

Color of cursor of CupertinoTextView

_images/cursor_color.gif

Python

CupertinoSearchBar(background_color=(0.5, 0, 0, 1))

KV

CupertinoSearchBar:
    background_color: 0.5, 0, 0, 1
foreground_color = [0, 0, 0, 1]

Text color of CupertinoSearchBar

_images/foreground_color.gif

Python

CupertinoSearchBar(foreground_color=(1, 0, 0, 1))

KV

CupertinoSearchBar:
    foreground_color: 1, 0, 0, 1
hint_text = 'Search'

Text of hint of CupertinoTextField

_images/hint_text.png

Python

CupertinoSearchBar(hint_text='Hello World')

KV

CupertinoSearchBar:
    hint_text: 'Hello World'
symbol_color = [0.55, 0.55, 0.6, 1]

Color of the symbols of CupertinoSearchBar

_images/symbol_color.png

Python

CupertinoSearchBar(symbol_color=(1, 0, 0, 1))

KV

CupertinoSearchBar:
    symbol_color: 1, 0, 0, 1
text = ''

Text of CupertinoTextField

Python

CupertinoSearchBar(text='Hello World')

KV

CupertinoSearchBar:
    text: 'Hello World'
class kivycupertino.uix.textinput.CupertinoTextField(*args: Any, **kwargs: Any)

iOS style Text Field to be used for single-line input

_images/demo19.gif
background_color = [0, 0, 0, 0]

Background color of CupertinoTextField

_images/background_color5.png

Python

CupertinoTextField(background_color=(0.5, 0, 0, 1))

KV

CupertinoTextField:
    background_color: 0.5, 0, 0, 1
cursor_color = [0.25, 0.5, 0.95, 1]

Color of cursor of CupertinoTextField

_images/cursor_color1.gif

Python

CupertinoTextField(cursor_color=(1, 0, 0, 1))

KV

CupertinoTextField:
    cursor_color: 1, 0, 0, 1
foreground_color = [0, 0, 0, 1]

Text color of CupertinoTextField

_images/foreground_color1.gif

Python

CupertinoTextField(foreground_color=(1, 0, 0, 1))

KV

CupertinoTextField:
    foreground_color: 1, 0, 0, 1
hint_text = ''

Text of hint of CupertinoTextField

_images/hint_text1.png

Python

CupertinoTextField(hint_text='Hello World')

KV

CupertinoTextField:
    hint_text: 'Hello World'
class kivycupertino.uix.textinput.CupertinoTextView(*args: Any, **kwargs: Any)

iOS style Text View for multiline input

_images/demo20.gif
background_color = [0, 0, 0, 0]

Background color of CupertinoTextView

_images/background_color6.png

Python

CupertinoTextField(background_color=(0.5, 0, 0, 1))

KV

CupertinoTextField:
    background_color: 0.5, 0, 0, 1
cursor_color = [0.25, 0.5, 0.95, 1]

Color of cursor of CupertinoTextView

_images/cursor_color2.gif

Python

CupertinoTextView(background_color=(0.5, 0, 0, 1))

KV

CupertinoTextView:
    background_color: 0.5, 0, 0, 1
foreground_color = [0, 0, 0, 1]

Text color of CupertinoTextView

_images/foreground_color2.gif

Python

CupertinoTextField(foreground_color=(1, 0, 0, 1))

KV

CupertinoTextField:
    foreground_color: 1, 0, 0, 1

Contributing

To help improve this project, fork our repository and install Kivy Cupertino with the dev extra:

$ pip install kivycupertino[dev]

Visit the projects page to view pending projects you may be able to work on

License

Kivy Cupertino is licensed under the MIT license

Copyright (c) 2021 cmdvmd
Portions Copyright (c) 2021 arnavs-0
Copyright (c) 2010-2020 Kivy Team and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Indices and tables