Giter Club home page Giter Club logo

input-framer's Introduction

Input-Framer

Framer module to easily turn your designs inputs into real inputs.

Input Demo

Add it in your Framer Studio project

  • Download the project from github.
  • Copy input.coffee and keyboard.png into modules/ folder.
  • Import it in Framer Studio by writing: InputModule = require "input".

Note: keyboard.png is prepared for iPhone 6. If you want to use a different size, replace with your own image.

How to use it

Export your assets as you would do normally, then create an input object and place it over your designed input. Done!
Remember that all parameters are optional.

input = new InputModule.Input
	setup: false # Change to true when positioning the input so you can see it
	virtualKeyboard: true # Enable or disable virtual keyboard for when viewing on computer
	text: "Some text" # Remove this if you don't want to have text initially
	placeholder: "Username"
	placeholderColor: "#fff"
	type: "text" # Use any of the available HTML input types. Take into account that on the computer the same keyboard image will appear regarding the type used.
	y: 240
	x: 90
	width: 500
	height: 60
	goButton: false # Set true here in order to use "Go" instead of "Return" as button (only works on real devices)

Styling your input

input.style = 
	fontSize: "30px"
	lineHeight: "30px"
	padding: "10px"
	color: "white"
	...

Retrieving value of your input

You can access directly to .value property to get the value. For example to get the value on each key up you could do something like this...

input.on "keyup", ->
	print @value

Focusing the input via code

Imagine that you want to focus the input once you click "myButton", here is an example:

myButton.on Events.Click, ->
	input.focus()

[Advanced] Accessing original elements

The input layer is constructed of a form and an input field. You can always access those elements by accessing directly to the properties input and form.

Example:

someNiceInput.form.addEventListener "submit", ->
	print "The form was submitted"
someNiceInput.input.something...

input-framer's People

Contributors

ajimix avatar

Watchers

James Cloos avatar Vicky Yang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.