Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

OS 6.2 (1 of 3): User interface features

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

50 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

The button that does nothing

You tap Pay. Nothing happens. You tap again. Still nothing. Did it work? Did it take your money twice?

You delete the app.

A good interface always answers the user. Today you learn the tools for this: pictures, movement, sound, touch and charts.

Key words

WordWhat it meansExample
User interfaceEverything a person sees and uses to work with a program.screens, buttons, sounds
InputWhat the user gives to the program.a tap, a typed word, a voice command
FeedbackThe answer the program gives back to the user.a message, a sound, a buzz
AnimationMovement on the screen over time.
EffectA visual change that adds style.
HapticFeedback you feel.
Data visualisationShowing numbers as a picture.
DashboardOne screen that shows the most important figures together.
GraphA chart that draws numbers as bars, lines or points.
PixelOne tiny dot on a screen.

The cells students fill in are left blank in this preview.

The tools of an interface

FeatureWhat it doesUse it forTake care
ImagesShow a pictureProducts, icons, mapsBig files load slowly. Add a text description for blind users
AnimationMoves thingsShowing something is loading or changedToo much is tiring. Let users turn it off
AudioPlays soundAlerts, music, spoken helpNever play loud sound without being asked
EffectsFade, shadow, colour changeShowing a button is activeKeep them simple and quick
HapticBuzz or vibrationConfirming a tap on a phoneNot every device can do it

The cells students fill in are left blank in this preview.

Animation makes a button grow

Code: web
<button class="pulse">Press me</button>

Make a free account to save your work and track your progress.

Check: interface tools

Have a go

Check: interface tools

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Check: effects and care

Have a go

Check: effects and care

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Input and feedback

An interaction has two halves. The user gives input. The program gives feedback.

Input can be a tap, a click, typing or a voice command. Feedback can be textual (a message), graphical (a colour change), audio (a sound) or haptic (a buzz).

Every input needs a clear answer, and it needs it fast.

A click gets three kinds of answer

Code: web
<button id="pay">Pay £5</button>
<p id="message"></p>

Make a free account to save your work and track your progress.

A short sound confirms a press

Code: web
<button id="beep">Play a sound</button>
<p>A browser plays sound only after the user presses something.</p>

Make a free account to save your work and track your progress.

Flashing is not only a style

Warning

Many people think a flashing effect is only a matter of style. It can harm people with some health conditions. So never flash more than three times in one second. Give users a way to turn off sound and movement.

Showing data as a picture

Numbers in a long table are hard to read. A picture shows the story at once.

This is data visualisation. A dashboard puts the most important figures and charts on one screen. The choice of chart matters.

Which chart for which question?

QuestionChartExample
Which is biggest?Bar chartGoals scored by each player
How does it change over time?Line graphYour phone battery during a day
How are parts of a whole shared?Pie chartHow you spend your phone time: games, music and chat
What is the exact number?Table or big figureToday's sales on a dashboard

The cells students fill in are left blank in this preview.

Code draws a bar chart

Worked example: bar heights

ValueStep 1: multiply by 100Step 2: divide by the biggest value (10)Height
33 times 100 = 300300 divided by 10 = 3030 pixels
77 times 100 = 700700 divided by 10 = 7070 pixels
1010 times 100 = 10001000 divided by 10 = 100100 pixels (the biggest bar)

The cells students fill in are left blank in this preview.

Charts and feedback: find the match

Have a go

Loading…

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Scale each bar to the biggest value

Write two JavaScript functions. barHeights gives the height in pixels of each bar in a chart. The biggest value gets the full height. Every other bar gets a smaller height in the same way. Round to a whole number. labelFor makes the text for a label. Press Run Tests.

Code: node
function barHeights(values, maxPixels) {
  // values is a list of whole numbers, such as [10, 25, 50].
  // The biggest value gets a bar of maxPixels. The other bars get a smaller height in the same way.
  // Round each height to a whole number. Give back the list of heights.
  return [];
}

function labelFor(name, value) {
  // Give back text like: Goals: 12
  return "";
}

Make a free account to save your work, or press Start lab to work through the whole lesson.

Build a small football dashboard

Build a small football club dashboard. Show three big figures: wins, draws and losses. Draw a bar for each one, with a height that matches the number. Add a button "Add a win". When it is pressed, the win figure and the bar both change. Add a text message as feedback. Your teacher marks this task. Check that a new user can see what the page shows within five seconds.

Code: web
<h1>Football club dashboard</h1>
<!-- 1. Show the three numbers as big figures with labels: wins, draws, losses. -->
<!-- 2. Add a bar for each number. The bar heights come from the numbers. -->
<!-- 3. Add a button that says "Add a win" and updates the figures and the bars. -->
<div id="figures"></div>
<div id="bars"></div>
<button id="add">Add a win</button>

Make a free account to save your work, or press Start lab to work through the whole lesson.

Exit quiz

Have a go

Exit quiz

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.