The first time I became aware of brand inconsistency was four, maybe five years ago. Companies were extending their appearances to apps, social media and other digital channels. And so did the bank I worked for back then. Unfortunately, no style guides were available to cover these channels.
I remember the dilemma while writing specifications: there were some older corporate identity manuals and some static UI style guides. Then, you’d look at newer web projects and none of them reflected the guidelines. So, what was I to do? Strictly obey the guidelines and produce something that looks outdated, or adapt to modern channels and risking a user experience that diverged from existing customer touch points?
Regarding website design, 2015 has passed under the auspices of flat style. However there were also other factors that shaped the Web the previous year, such as asymmetrical arrangement, which helped projects to break away from traditional boxy structures, a ton of multimedia, which was huge, lavish and overwhelming, nifty and intriguing two-column homepages, enthralling long landing pages, and of course, one of the freshest trends: intensive coloring and saturated gradients. As for the graphical filling, the artists prefer to stick with elegant and subtle looks opting in favor of ghost buttons, line style icons, minimalistic hamburger menu buttons and neat and sleek controllers and switches.
Want to brush up some excellent examples? Then take a look at our Best Of collection. There are one hundred free website layout themes that are hip, stylish, trendy, sophisticated and increasingly flat. You can download the samples and use them for your purposes.
Adobe has recently announced the release of major updates to three of its apps: Animate CC, Muse CC and Bridge CC. All of these applications have been overhauled and are now ready for download.
Adobe Animate CC is, basically, a revamped version of Flash Professional (Adobe had announced the renaming of Flash Pro as Animate CC back in late 2015). Animate CC comes with a long list of features and updates, such as better support for HTML5 Canvas documents, new vector art brushes and tools as well as SVG support, and support for TypeKit and Creative Cloud libraries.
Adobe Muse CC too has got a major update, and now it supports responsive layouts straight out of the box. You can create responsive design layouts for your site without having to deal with any code whatsoever. Plus, you can make use of Creative Cloud Libraries, and make use of assets in your projects within Muse.
Lastly, Adobe has announced the release of Adobe Bridge CC 6.2 which comes with many new features such as automated cache management and on-demand thumbnail generation. Earlier, when working on Mac OS, Bridge CC did not recognize iOS devices such as iPhones, nor did it work well with Android phones and tablet if those were connected in media transfer mode. This has now been fixed, and you can import from such devices when working on Mac OS. Plus, the Autostack Panorama/HDR feature has been revamped as well.
You can learn more about the Animate CC and Muse CC updates on this page, and the Bridge CC update here.
* You might also be interested in the following articles
Adobe have just launched their ‘new’ application, Animate CC. A major component in the Creative Cloud application suite, Animate CC replaces Flash Professional CC, and is available to download now.
As we previously reported, Animate CC is an evolution of Flash Professional. The name change is based on the changing role of the application. Adobe believe that the renaming of Flash Professional CC as Animate CC more clearly defines its position, and its purpose: Flash Professional was for producing SWF content, Animate CC is for producing animation.
the Flash brand may be something of a pariah, but animation is one of the hottest trends on the web
Although Flash Professional CC has exported to numerous formats for some time, the change in emphasis from proprietary technology to web standards has opened up a realm of new possibilities for the community-formerly-known-as-Flash; the Flash brand may be something of a pariah, but animation is one of the hottest trends on the web.
What’s it for?
Animate CC is, as the name suggests, designed for any animation job. That ranges from micro-interactions, to banner ads, to interactive infographics.
Anyone who spends time putting together app prototypes, animated Dribbble shots, or simply wants to design with motion, will find Animate CC invaluable.
A lot of attention on Animate CC will inevitably focus on what’s new, but what I find most attractive is what isn’t. As someone who first picked up Flash 4, many years ago, what excites me about Animate CC is how familiar it is. This is a new application that uses tools I’m already proficient with. What’s more, in addition to Actionscript, Animate CC will accept JavaScript, so the scripts we used to replace Flash animation can now be repurposed as part of a powerful, unified workflow.
What’s new?
Animate CC marks something of a renaissance for the application. Feature additions have stagnated under the Flash name in recent years, as Adobe focused on patching security issues, and sought ways to integrate Flash into the new world of responsive design. Animate CC introduces more new features than the last two CS versions of Flash combined.
A major update is the ability to resize the stage, anchoring content to any position. Streamlining the process of scaling designs. You can now export for multiple resolutions, invaluable for bitmap work. Animate CC also introduces new vector drawing tools, including some astounding new vector brushes that don’t need to be converted to shapes to be edited.
Some of the new vector brushes.
Animate CC joins the rest of the Creative Cloud range by integrating CC Libraries, allowing you to share assets across multiple files. If you’re exporting for HTML5 Canvas you can also take advantage of Typekit integration.
Adobe Stock integration.
One of the coolest new features—expect to see it introduced across the Adobe CC range—is tagged swatches. Think of tagged swatches as Sass variables, but for vector graphics: set a color as a tagged swatch, use it in your artwork, later on make a change to the swatch and see the color updated in your artwork; give it a month and you’ll wonder how you ever lived without it.
Tagged swatches in action.
About those formats…
Arguably the biggest issue for the Flash platform, and by extension Flash Professional, was its reliance on an installable plugin that no one wants to install. Animate CC frees the application from the player by embracing web standards, opening up the whole of the web, including mobile.
According to Adobe over a third of the content produced in Flash Professional CC was HTML5, and in Animate CC you can export for HTML5 Canvas, WebGL, 4k video, you can even generate a sprite sheet based on keyframes and animate through them with CSS. Animate CC also introduces .OAM packaging, which is essentially a .zip format allowing you to package up assets to import into other Adobe tools like Muse CC, or Dreamweaver CC. Perhaps the biggest news is that Adobe have learnt the lesson of Flash, and have future-proofed Animate CC by building in export support for as-yet-undefined formats—just in case there’s another revolution around the corner.
The new OAM format.
The one downside of the multiple format options is that you need to be aware of the technical limitations of the format you’re exporting to; not all of Animate CC’s features are supported by every format. Helpfully Animate CC will warn you if you try and export a feature that your chosen format doesn’t support.
It’s worth noting that Animate CC hasn’t abandoned the SWF format, you still have the option to export for the Flash player. However the expectation must be that most designers will export for web standards, if only to maximize reach.
Is it any good?
if you use Animate CC to add an ill-advised ‘intro’ to your site, that’s on you
Of course, haters gonna hate. Animate CC will inevitably be dismissed by some as “Flash by another name”. However, never has it been so true that a bad craftsman blames his tools: Animate CC exports to web standard formats, it doesn’t require an embedded player, and there are no inherent security vulnerabilities; if you use Animate CC to add an ill-advised “intro” to your site, that’s on you.
Animate CC may not be the perfect animation tool, but for the first time in years it feels like appending “yet” to that statement may not be so foolish. Against the odds, Adobe may have succeeded in breathing new life into an application many designers never expected to install again.
We all know really good that there are many projects on the martket, projects that can be easily made with the right tools. Today, we want to present you 12 awesome tools that can really bring value to your team and projects.
Using any of these tools, you will find that you can work on multiple projects and that your clients are happy with the results.
Have you ever thought at managing your event tickets just by yourself, having full control over your profits with no requirement to send a cut to a third party? With the help of Tickera WordPress plugin, you can now sell tickets directly on your website and personalize them the way you need and the way you like. How? The fusion between WooCommerce, the most popular e-commerce system for the WordPress platform, and Tickera makes it all possible!
The integration is called Bridge for WooCommerce and it lets you do amazing things with the management of your tickets. You can easily create tickets inside WooCommerce as you can create any other product, by setting their own details such as price or stock, you can set the ticket templates and make different looks for each ticket type with the Tickera drag & drop template builder. On top of that, you can easily check-in attendees with mobile apps or barcode reader and after that you can export the attendee list (as a PDF document or in the CSV format), so that you will have a good evidence on your customers.
Other features given to you by Tickera are shopping cart (so that you do not limit at just one item), discount codes, multiple events managing, translation ready, and, at least but not last, good support service, as their team is very fast and helpful with any problem you encounter.
If you have ever lost a file (which I’m 99% sure happened to you) or had a computer die, losing all your data, I strongly recommend you Backblaze, probably the best online backup solution for all your files. It has such an easy-to-use interface and it is low-cost, with only $5/month for the option of Personal Backup, which focuses on your own computer and files. This option has automatic or scheduled backups that keep your data safe in secure datacenters with 24-hour staff, biometric security and redundant power. Moreover, all your files are encrypted before being transmitted over SSL and stored encrypted. In addition, you are constantly notified of your backup status and you can choose the auto throttling option or set your own upload limit. At last but not least, another great feature of Backblaze is their restore option: you can have a USB Flash Drive (128GB for $99) or a USB Hard Drive (up to 4TB for $189) sent to you via FedEx, which you can send back within 30 days for refund. Sounds pretty cool, doesn’t it?
An image is worth a thousand words. We all know it, we have to be honest. Especially website administrators, web project managers and even the marketing department of your company. So what do you need for your website? An automated screenshot service: Shrink The Web does exactly that. A single line of code in any of the plugins that support STW, from WordPress to Django, or in any other server-side language like PHP or Ruby on Rails (And even Perl!!!) can help you take automated screenshots of your website or any other website. Anybody can work with this platform, for free, but there are limitations for the default sizes, the largest being 320 by 240 pixels. Speed is not a problem, as it is a capable service with low waiting time. Undoubtedly, a paid account is a great deal due to the amazing features it comes with: URL to PDF conversion, custom sizes and even whole-length page screenshots, above-the-fold content not being your limit anymore. You should definitely give it a try.
Why do people love Ultimatum Theme? Graphic designers appreciate that they don’t have to code too much to achieve great results, with imagination as their only limit. Project managers talk about how they can turn their clients ideas into real working websites. And at last, web designers say they now have the certainty they can create any design. The truth is that website builder comes with a drag-and-drop editor and more themes you will ever need that can help you ship an unusual blog, a successful store or even a great portfolio. Although the prices are not that low, the lifetime license worths every cent of the 65$ basic accounts. You should check it out an tell us your opinion!
Would you like to build attractive sites for your business, but have no coding experience? Simbla Website Builder is one of the online platforms that helps you do this, thanks to its clean and easy-to-navigate interface. In order to start using it, you don’t even have to install it, but just complete a few fields including email, password and location. How easy, why not give it a try?
Themify.me offers a website builder service, with lots of original themes. Some of them are free, to offer you the experience of using a drag and drop layout editor, but a paid account comes with more designs to choose from. Having some extremely interesting themes to begin with, with functions like parallax backgrounds, you can get anything done. For more, you can visit their website.
Would you like to empower your business management? TeamDesk gives you the chance to do this by allowing you to create online databases for you and your team, that you can share, discuss and edit together. This will highly facilitate your work and the best part is that it requires zero technical knowledge. However, if you need help, you are provided with expert support from their team.
If you want to have an insight of what your visitors do on your site, Hotjar gives you the perfect tools to do that, by revealing your visitors’ pattern of reading the page and navigating on it. It has many features, but one of the best is heatmaps: it allows you to see what grabs your visitors attention by visually representing their clicks, taps and scrolling behaviour.
Unlike the majority of site builders that work in your browser, Mobirise is an offline program that you need to download and install on your computer. Once installed, building a mobile-friendly website is fast and easy: by dragging and dropping, you will considerably reduce the development time and you will have a new site within minutes! Needs no coding experience and it is free for commercial and non-profit use, go on an try it!
If you have just started your own business and you are looking for a place to promote it in a really simple and efficient way, uKit is indeed the best choice for you. It is a website builder for business which you can initially use with a free trial period, and we are sure it won’t disappoint you. Coming with a lot of features, it is a must on the online rankings such as the ones on http://superbwebsitebuilders.com/, by Howard Steele.
Xfive is here to ease your web development challenges, by helping you with many things that will make your website grow faster and better. Whether you would like to have your designs converted to a WordPress theme or you want to do anything complex with JavaScript, you can rely on them, as many other big companies have already made, including ebay, Twitter or Microsoft. You can be the next one!
You’ll be surprised how well IM Creator makes your websites look once you’re done, without any effort and in a matter of minutes. Creating a website with XPRS or IM Creator is easy, fast and intuitive. Thanks to the new Polydoms technology implemented in the XPRS website builders, IM Creator is far above any other website builder on the internet. If not convinced, go give it a try or ask its users!
When it comes to web projects, real estate and home appliances go well together, so today we’re happy to release a lovely free icon set with 72 related icons. The set includes icons in 4 sizes and in 8 formats: AI, CSH, EPS, SVG, PDF, PNG, Sketch and Webfont. The icon set is free to use in personal and commercial projects. Designed by Funline Icons.
Feel free to modify the size, color or shape of the icons. No attribution is required, though reselling bundles or individual pictograms isn’t allowed (and it isn’t cool either). Please note that the set is released under a Creative Commons Attribution 3.0 Unported license. We’d kindly like to ask you to provide credits to the creator and link to this article if you would like to spread the word.
Ever since 2014, Material Design has been Google’s preferred design language, with the company encouraging its use in different applications and design projects. Many designers have been quick to adopt Material Design, especially in terms of Android apps and occasional web design projects.
However, Google itself has not shown much favor to Material Design so far, with virtually none of its offerings being designed in Material Design.
All of that seems to be changing, as Google is planning to redesign Google Chrome using Material Design.
Yes, the latest version of Google Chrome is expected to feature some design elements from Material Design — there will not be any monumental design changes, but some minor elements will be introduced, as a form of transition towards Material Design for desktop users of Google Chrome.
The most obvious changes, clearly, will be made on the Downloads, Extensions, Settings and History pages of the web browser. As such, you can expect Google Chrome to get even more minimal and feature more flat design elements in its layout and appearance.
It will also be interesting to see how Google will approach the development of Google Chrome vis a vis Material Design, especially with desktop user base of the browser already being outnumbered by the mobile users. So far, Google has already been using Material Design principles on Google Chrome for Android and iOS devices, and now that the news is out, you can expect to see Material Design in practice on Google Chrome for desktop devices as well.
This article is not intended for seasoned React pros, but rather, those of us who make websites for a living and are curious how React can help us reason about updating user interfaces. I’ve been intrigued by React for some time, and now that it has gained some standing in the community as well as good reviews, the time to learn it seemed justified. There are so many new technologies constantly emerging in front end development that it’s sometimes hard to know if effort into learning something new will pay off. I’ll spend this article going over what I think some of the most valuable practical takeaways are so that you can get started.
Fair warning
I’ve only spent about a week working with this material. That’s on purpose. I’m writing this while I’m fresh with the technology and can write about it from that perspective. In this state I’m much better at remembering the tumbling blocks and findings along the way.
It is imperfect, but it goes much farther than I would have gotten on my own in that amount of time.
If you’re the kind of person who wants to dive right in and learn it all, including the build and requisite tooling, that’s awesome! Here’s where to start. I would also suggest this pretty great Frontend Masters course: Modern Web Apps.
Mythbusters: Practicality in React Edition
Before we get started, there are a couple of key myths I’d like to debunk that I think are blockers for a lot of people.
Myth #1: You have to use inline styles to use React.
Nope! Not at all. You can use CSS just as you normally do. Having just spent a lot of time refactoring a giant CSS codebase, I would say that this is pretty important to establish. React, being fairly new, has not yet had to stand the test of design refreshes like other technologies have. If I had had to go back through thousands of lines of inline styles just to update things like padding and line-height, that would make me a sad developer indeed.
That said, there are times when inline styles do make sense. If you have a component that will change styles depending on its state (for instance: a data visualization) it would make absolute sense to work with inline styles so that you’re not maintaining an impractical number of static styles (in multiple places) to handle all possible states.
I’d think, though, that this would be on top of a base CSS that the application uses and be an exception rather than a rule. The web is a big place, though, so there are no absolutes.
Myth #2: You have to use JavaScript syntax for element attributes, which is not at all like HTML.
One of the things I really love about Wes Bos’ teaching style is that he guides the viewer towards the more familiar approach and implementation. I generally like to err on the side of simple, and less obfuscated code, though I understand that others like higher degrees of abstraction.
He suggests that we write our markup with JSX, which more closely resembles our friend, traditional HTML, so I found it to be much more clear. So, instead of this:
Either works. But when we start to have more and more complexity in our markup, I found that the familiarity of HTML in the form of JSX served my understanding. Please keep in mind, though, that even with JSX, there are minor differences.
Myth #3: In order to try React, you have to understand all of the build tools.
It’s true that in order to use React, you need to use build tools, so this is usually what tutorials start with. I would recommend, though, that as a total beginner, you should muck around on CodePen, JSBin, or JSFiddle. It’s a good way to iterate quickly and learn before investing a lot of time in a brand new technology. For the purpose of getting us off the ground, I’ll be using CodePen for today’s examples.
Using React in Typical Applications
In typical applications using React 1.14+ we would start out by requiring React and ReactDOM:
var React = require('react');
var ReactDOM = require('react-dom');
In our case, we will simply be selecting React from the dropdown in the JS panel (click the cog icon at the top of the panel), and then using Babel as the compiler.
We don’t need to require React or React DOM, since we haven’t routed anything, we’re using the app component directly. Our code will be amended simply to:
Let’s break this down. On the last line we find the main div id, and on that we render the component, which will load all of our React application. You can use your React tab in Devtools to now see the DOM element we’ve created.
We’ve attached as the first component. The first thing to note here is that this tag is capitalized — while this isn’t required it’s a best practice with React components. The second is that it is self-closing. Tags in react must be closed, either by an additional closing tag (e.g.
), or a self closing tag (e.g.
would become
). This is just how JSX works and an error will be thrown otherwise.
Note the structure for creating the app component at the top. You will get very used to this syntax moving forward, as everything we will build today will work off of this key building block.
The last thing to note is that rather than using class, we’re using className on the element. This is a gotcha if you’re used to writing HTML markup for a webpage. Luckily, it’s easily solved. For more information on JSX and its syntax, these docs are really good resources.
In the next step, we’re extending app with a component. Header can be named whatever you would like it to be named, for clarity, we’ve named it the role it has in the document. You can see that if we also wanted to add a navigation element, that would be quite simple to add. Here’s the same page with just a standard bootstrap row of buttons for a component, and the more semantic h1 for our “Hello, World!” instead of a div:
Pretty straightforward, huh? It’s just like building blocks of any web page. We make the nav and the header, and apply these components to the app component, which is rendered on the body. The only real gotcha of this last example would be the strange extra div you see around and . This is because we must always return a single element. We can’t have two sibling elements, so we wrap them in a single div.
Now that you understand the building blocks, you can probably pretty easily piece together a page using React and React components. I’d suggest refactoring a page layout you’ve already made just to learn. Throw the stylesheet in there, and piece out the rest bit by bit until you’ve reconstructed its bones. It’s great practice.
There is a way to automate this process, but I would not suggest using a tool like this until you have already gone through the steps of building things out for yourself first. That way if you run into problems down the line, you know what’s going on.
The Usual Suspects: Variables & Event Handling
Let’s do some small event handling and put in some simple variables first just to see how that goes.
Consider the first demo again (we’ll use this throughout the article):
The blog post component has some pretty simple markup, so let’s start with that:
// Blog Post
var Post = React.createClass({
render : function() {
return (
<div className="blog-post">
<h3 className="ptitle">{this.props.ptitle}<small>{this.props.date}</small></h3>
<img className="thumbnail" src={this.props.pimg} />
<p>{this.props.postbody}</p>
<div className="callout callout-post">
<ul className="menu simple">
<li>Author: {this.props.author}</li>
<li>Comments: {this.props.comments}</li>
<li>Tags: {h.getTaggedName()}</li>
</ul>
</div>
</div>
)
}
});
Let’s add an arbitrary variable and event handler to see how that works. First thing to think about is that if we’re using JSX, curly brackets will let React know that we’re ready to use some JavaScript. Therefore our variable will look like {var}.
We’re going to add the variable statement inside the render function call, but before we return the markup. We can then access it by calling the variable, in this case, {com}. The click event is an inline onClick handler, which probably goes against best practices you’re used to. This is a name we chose, whereas render is a framework method. We call {this.tryClick}, and write a method stored as tryClick (an arbitrary name) within the same component, like so:
// Blog Post
var Post = React.createClass({
tryClick : function() {
alert('just trying out click events lalala');
},
render : function() {
var com = "Comments";
return (
<div className="blog-post">
<h3 className="ptitle">{this.props.ptitle}<small>{this.props.date}</small></h3>
<img className="thumbnail" src={this.props.pimg} />
<p>{this.props.postbody}</p>
<div className="callout callout-post">
<ul className="menu simple">
<li>Author: {this.props.author}</li>
<li>{com}: {this.props.comments}</li>
<li>Tags: {h.getTaggedName()}</li>
</ul>
</div>
</div>
)
}
});
The syntax for events in React begins with “on” and is camelCased. For example:
click = onClick
mouseEnter = onMouseEnter
keyPress = onKeyPress
You can find a full list of all the supported events.
Combining React and Other Libraries (Greensock, in this case)
I love GSAP for animation. You can use other libraries within React, so let’s combine GSAP and React and see how that goes.
We want to access other libraries at the correct time, so we have to make sure they are called immediately after the first render method. The method we use for this is called componentDidMount. We’ll explain a little more about other lifecycle methods further on, but what you need to know right now is this method is called immediately after the component is inserted into the document.
If you’re used to jQuery, you’re familiar with grabbing elements right out of the DOM. In this case, even though we are tweening DOM elements, we’re going to use React’s getDOMNode() instead of just grabbing them. You’ll also see that we’re actually calling the function to tween in the app component, and simply passing it down to our boxes. (You may have to hit rerun to see the animation.)
You may be used to accessing the DOM through jQuery or vanilla JavaScript. We can still do so, but here we’re accessing pieces of the DOM through getDOMNode() and refs, on this line: var sq1 = this.refs.squares1.getDOMNode();. You can read a little more about this in the React docs.
There are more React-specific ways to include motion in your projects- a really great one is Cheng Lou’s React-Motion and another good mention is React-GSAP-Enhancer.
Creating a Global Helper Function
You can even write helper functions that can be accessed by multiple components easily. We would use these with the same dot notation that we used with this.functionName. We store the helper function (in this CodePen demo we will do so at the start of the file, but in real applications, they would be stored in a separate file) and declare each function as an object the same way you do within the component structure.
Something like the correctly formatted date in the first demo with the blog posts would be:
var h = {
getTime: function() {
var month = ["jan", "feb", "march"]; // …. and so on
var d = new Date();
var mon = month[d.getMonth()];
var day = d.getDate();
var year = d.getFullYear();
var dateAll = mon + " " + day + ", " + year;
return dateAll;
}
};
And used like so: {h.getTime()}
The Good Stuff: Managing State
Ok! Now that we have the building blocks down, let’s get to some of the cool stuff.
React is surely good at building apps with easy-to-understand bite sized components, but what it’s really good at is managing state for these components. Let’s dive into that a little.
For this part, we’re going to go over two pretty key parts of understanding how to access and work with things that change.
The first is state. The component itself possesses it, which means that it’s scoped to the component, and we will refer to it like this {this.state.foo}. We can update state by calling this.setState().
The second is refers to how we pass read-only data along from the parent to the component (think like app is the parent to header in the first example). We refer to this as props, as in property, and will use it directly in the components with {this.props.foo}. This data can’t be changed by its children.
Any time we change either of these two things and our component relies on it, React will re-render the pieces of your component that it needs to.
The beauty of the virtual DOM is that React figures out only which DOM Nodes need to be updated.
I’ve read a bunch on state now, but I think Wes said it the most clearly so I’m going to paraphase him: if you’re used to jQuery, you’re storing all of your data in the DOM. React avoids this entirely by by storing the data in an object (state), and then rendering things based off the object. It’s like one big master that everything is based off of.
Trying Props Out
Let’s try just this.props first, we’ll add {this.props.title} to the Header component, and then we can access it within the app. We’ll add a string to create the title:
We can also add a default for props, in the aptly named getDefaultProps lifecycle method. This is great because sometimes you don’t want to have to specify props for every component. An example of this would be a default profile avatar if the user hasn’t set one yet, like the egg on Twitter, or setting a list to be an empty array which will be filled up later.
Now let’s build off of that to work with state a little. If we’re going eventually change this.state, we have to get it ready. To do so, we’ll use getInitialState, which lets us define what the state is at the get-go. We can’t add state without this.
Let’s just change the background based on user selection.
// App
var App = React.createClass({
/*setting state*/
getInitialState: function() {
return {
bgColor: "teal"
};
},
/*changes state*/
handleColorChange: function (color) {
// when we set state directly, react doesn't know
// about it. that's why we use setState
this.setState({ bgColor: color });
},
/*for the lifecycle methods*/
updateBackgroundColor: function () {
var body = document.querySelector('body')
body.style.background = this.state.bgColor
},
/*lifecycle methods*/
componentDidMount: function () {
this.updateBackgroundColor()
},
componentDidUpdate: function () {
this.updateBackgroundColor()
},
render: function() {
return (
/* by calling the title here on the component, we can access this.props on header */
<div className="foo">
<h1>Hello, World!</h1>
<label>What color?
<ColorPicker value={this.state.bgColor} onColorChange={this.handleColorChange}/>
</label>
</div>
)
}
});
// ColorPicker component
var ColorPicker = React.createClass({
propTypes: {
value: React.PropTypes.string.isRequired,
onColorChange: React.PropTypes.func
},
handleChange: function(e) {
e.preventDefault();
var color = e.target.value
// If whoever rendered us (the ColorPicker) is interested
// when the color changes, let them know
if (this.props.onColorChange)
this.props.onColorChange(color);
},
render: function() {
return (
<select value={this.props.value} onChange={this.handleChange}>
<option value="orangered">orangered</option>
<option value="teal">teal</option>
<option value="orange">orange</option>
<option value="indigo">indigo</option>
<option value="red">red</option>
</select>
)
}
});
React.render(<App/>, document.querySelector('#main'));
An important part of this to consider is that we need the handleChange function.
In regular DOM life, native selects would not require you to do something like this because it would automatically be updating to the users selection. In React all of the state is being managed by the component, so if you need an input or a select to listen for changes, you have to write it. This means that the component is in charge of the state, not the user.
This may seem like a lot of work for a small amount of reward, but we’ve purposefully kept these examples pretty slim. The cool parts of React really come in when you’re dealing with a lot of complexity. As much as I love jQuery (and I still do love jQuery, it’s not a boolean), you have to perform checks pretty frequently when something is changing. React solves this by removing this need because of the simplicity of the direction of data-flow, which also makes it easier in highly complex applications to reason about.
State Concepts
So now that we have the very basics down, let’s take a look really quickly at why we’re doing what we’re doing, as well as some best practices.
React works the best when we are updating states and rerendering the lower-level components. Fundamentally, we want these components to be mostly stateless, and receive data from the higher-level components. The components at the top of our hierarchy, like our app, work best when they are mostly stateful. That way they manage most of the interaction logic and pass state down using props. That said, there still will be times where each component will have it’s own state. It’s important to remember, though, that siblings shouldn’t talk to eachother directly, they should talk to their parent component.
Therefore, we want to keep the state in the component as much as we possibly can. You don’t ever actually have to worry about when stuff gets rendered. All you need to worry about is when state changes, and React takes care of rendering for you.
That kind of best practice ideology leads directly to why I’ll also advise you to not use props in getInitialState, and there’s more information here on why this is considered an anti-pattern.
We don’t want to abuse state too much. The rendering of the components is pretty fast, but performance can sink if you begin to try to manage too much state. There are some ways to get around this once it’s actually a problem, but best bet just to not get in that predicament to begin with.
The rest of this article is about how to best manage these states and keep the immutable concerns higher in the hierarchy, while still referencing our stateless components lower down.
Refs
We can also access information about the element with something called ref. We use refs by attaching it to any component. It is then returned during the render() method, and we can then refer to it outside of the render() method. This is incredibly useful.
Consider the first Pen again. Let’s think for a minute how we’re making these new blog posts, and use refs while doing so.
In each form input we have a ref, like:
<input type="text" ref="name" placeholder="Full Name required" required />
On the form element itself, we call:
onSubmit={this.createPost}
which references the createPost function above the render function, and uses refs to store information from that submission:
var post = {
name : this.refs.name.value,
...
}
and then we have a way to refer to it in the app state using this.props:
this.props.addPost(post);
That’s pretty handy because now we have a variable post, with objects that are storing its name (shown here), date, details, and so on. We still haven’t stored any of this in the App state yet, we’ve only created a way for App to use it. Let’s go over that next, along with keys.
I’ve used this example as a way of talking about refs in general, but in real-life applications, you might want to consider using something like form-serialize to serialize form fields to submit over AJAX.
Keys and Using Refs
In our last section we made a way to store the data we collected in the form without passing it off. That’s because in React, we want to manage this state in the top-level of our hierarchy. In order to store this state, we’re starting up our initial state with an empty object. That’s where we’ll eventually store our post data.
Then we have our addPost function. Note that we’re managing this here instead of on the form, even though we called it from the form. We’re giving the state a timestamp to keep the posts unique and also setting the state for the posts.
addPost: function(post) {
var timestamp = (new Date()).getTime();
// update the state object
this.state.posts['post-' + timestamp] = post;
// set the state
this.setState({ posts : this.state.posts });
},
Each child in an array should have a unique key.prop. This is important because React will reuse as much of the existing DOM as possible. React uses keys to keep track of which elements in the DOM it should update. It keeps us from having to redraw all of the DOM elements when we rerender. That helps the performance of our app.
Now let’s take a look at the App again, and see what we do with our newly stored data from the form:
// App
var App = React.createClass({
getInitialState : function() {
return {
posts : {}
}
},
addPost : function(post) {
var timestamp = (new Date()).getTime();
// update the state object
this.state.posts['post-' + timestamp] = post;
// set the state
this.setState({ posts : this.state.posts });
},
renderPost : function(key){
return <NewPost key={key} index={key} details={this.state.posts[key]} />
},
render : function() {
...
return (
<div>
<Banner />
...
<div className="list-of-posts">
{Object.keys(this.state.posts).map(this.renderPost)}
</div>
<Submissions addPost={this.addPost}/>
</div>
</div>
)
}
});
You can see that when we render the app, we use the Object.keys to create a new array. We then use .map() with the renderPost function we made earlier. For those unfamiliar with .map(), it’s useful for creating an array out of an existing one, you can think about it like a loop.
Now let’s make that renderPost function we just called. We pass the key as a parameter and assign it as the key, the index, and create an object we’re calling details to hold information about the state of the posts.
It might seem odd that we pass a key and an index, but inside a component we are unable to access the key prop so we pass another one called index. This renderPost function is simply creating a component for every item in our array, with details passed down that we can access. This is pretty awesome because it means that if something in our state updates, it’s propagating down and we can manage it in one spot.
Here’s the component, where we use details handed down from app to render all of the information. You can see that helper function we made earlier used for the correctly formatted date used here as {h.getTime()}:
Now that we understand keys, let’s take a look at the big picture for a minute. We discussed getInitialState, componentDidMount, and render, but there is one more mounting method for React. It’s called componentWillMount. It’s similar to componentDidMount, but it executes immediately before the component renders for the first time.
This diagram does not include everything that is available in React at all, but rather a glimpse at what we’ve covered thus far and enough to get you started playing around.
Conclusion
There’s a lot more than this article to learn about React, this is just the start. Hopefully this beginner’s journey gives others a little insight into how to get up and running. This post was 20 pages long and we didn’t even get to a ton of other important and related subjects, including but not limited to ES6, Browserify, Gulp, Webpack, or a myriad of alternative implementations.
For further learning, again, I highly suggest diving into Wes Bos’ course, and he’s offering a 10% discount to CSS-Tricks readers with the code CSSTRICKS, as well as watching some videos on Frontend Masters. Michael Jackson has a wonderful training course that you can register for (we’re having him come to Trulia in San Francisco in March! Stay tuned for sign ups). There’s also a great book by Artemij Fedosejev called React Essentials and this list that’s worth bookmarking by Artem Sapegin. It shouldn’t be understated that the React Docs are quite good resources. Happy learning!
Welcome everyone to February’s portfolio roundup. It’s time to fall in love with all-new work, by all-new designers. Yes, I went there.
Dig in, enjoy, and let us know which were your favorites. If you’ve got a portfolio that you’d like to submit for next month’s roundup, write to the author at ezequiel@webdesignerdepot.com.
Note: I’m judging these sites by how good they look to me. If they’re creative and original, or classic but really well-done, it’s all good to me. Sometimes, UX suffers, for example many of these sites depend on JavaScript to display their content at all. This is a Bad IdeaTM, kids.
So, when looking at this list, I recommend that you take inspiration from the good ideas, and simply ignore the bad.
All right, let’s do this…
Taiki Kato
Taiki Kato’s portfolio proclaims him an art designer, and it shows in the design. This distinctly minimalist site makes exceptional use of typography, both in English and in Japanese. It’s not easy to feature two languages side by side and make it look good, but he manages it.
Blackmeal
Blackmeal is a studio that specializes in motion design. Like many others, they have chosen to craft a minimal design that lets their work speak for itself. With a simple design, good UX, and obvious talent to show off, Blackmeal’s portfolio is, to my mind, the best kind.
SpaceCraft Joinery
SpaceCraft Joinery showcases their furniture-building and interior design in a decidedly work-first portfolio with short, sweet case studies. They’re only a couple of sentences long, but interspersed with the chosen imagery, they make a compelling statement about the thought process behind each project.
Jan-Paul Koudstaal
Jan-Paul Koudstaal’s portfolio looks great, works great, and finally does something interesting with the whole screenshot-of-site-in-mobile-device trend. Instead of using a big one for the hero image, the format is used to create medium-sized thumbnails for each project.
I don’t know how I feel about each project linking to Behance instead of a page on his own site… but I bet it’s easier for him. On the whole, it’s a fantastic one-page portfolio.
Henrik and Sofia
Henrik Leichsenring and Sofia Gillström work together as partners in a design studio. Their portfolio is a pretty fantastic example of what happens when designers workout what their style is, and largely stick to it.
The low-contrast between text and background in the “about us” section of the home page may come back to bite them, but the rest of the site is a fantastic combination of decent UX and modern style.
Feed
Let’s get the bad out of the way: I don’t like it when sites depend on JS for displaying content and navigation to the point that the site breaks down without it. I don’t like parallax either.
That’s why I’m surprised that I like Feed’s website so much. The parallax effect that they use for their portfolio runs fast, feels understated, almost natural. I like understated and natural. Now if only they’d fix their UX bugs.
Rafael Merino
Rafael Merino’s portfolio is just pretty enough to look at in full-screen mode. You won’t find anything groundbreaking in the typography or the layout, but it all gets tied together with the imagery in a way that makes you want to scroll through every page.
Omnam Group
The Omnam Group’s portfolio centers around their property development in a pleasantly minimalist fashion. I especially noticed their excellent use of whitespace. It’s hard to make a design featuring monospaced body text look this good, but they’ve done it.
Filip Turner
Filip Turner’s work is full of geometric design, and strong typography. His portfolio site is no different. While he follows the trend of giving the entire “first screen” to his slogan, his work is otherwise brought front and center, and then left to its own devices.
Leandro Lima
Leandro Lima shows off his illustration and interactive art direction in a dead-simple portfolio that uses strong story-telling on each project page.
Combined with a design that can truly be described as relaxing, it makes you want to spend a while just scrolling through his work. It’s almost therapeutic.
Lu Yu
Lu Yu’s portfolio demonstrates her distinct style on every page. Every page is almost like a unique work of art, with varying color schemes, and a layout designed to match the content. There’s no cookie-cutter work here.
Frank Chimero
Frank Chimero’s writing portfolio does a fantastic job of showcasing the best of his work. Only his featured articles get thumbnails, though. The rest are put in a list. I suspect that the entirety of his article portfolio is designed to help him sell his books, which is fair. With his simple, no-nonsense design, and pleasant-to-read typography, it works.
Isaias Mulatinhi
Isaias’ portfolio is reminiscent of magazine layouts, but it’s very obviously built for the Web. It mixes a highly animated design with a classic dark-grey-and-bold-red scheme.
Deadwater
Deadwater’s site features a simple, though unconventional (for the Web) design. Their design is enhanced by the use of simple animations. That, and it’s just pretty.
Zeecom
The design over at Zeecom seems to follow the recent trend of half-overlapping your text (and other elements) onto images, or across background colors in an asymmetrical design. While this often makes other sites harder to read, the people at Zeecom got it right.
Andrius Petravicius
It’s hard to create a design that looks simultaneously playful and business-serious, and Andrius Petravicius makes it look easy. His illustration-rich design plays well with the all-business color scheme to say, “I make stuff look quirky, fun, and pretty on a deadline.”
It’s odd, but cool.
Blid
This fashion design portfolio puts the work right in front of your eyeballs from the get-go. It’s simple, pretty, and organized by fashion seasons.
The designers did make some odd choices about the way people are supposed to interact with the site, but from an aesthetic and organizational standpoint, it’s minimalism in its most perfect form.
B?ro Benedickt
I’m actually a huge fan of monochromatic designs, but they’re hard to pull off. With no color to help you out, your layout and typography had better be fantastic. This one pulls it off, though there is actually some color, in the portfolio section, which is appropriate.
Andrew Zellinger
Andrew Zellinger went with the classic big typography, big images, no subtlety approach. Hey, why mess with a good thing, if it’s still working?
Bitcookie
Bitcookie almost feels like a throwback, in terms of site structure and imagery. Half their navigation links are about their services, and you have to click through to see their portfolio. It’s not hard to find, but it bucks the trend of putting your work right on the front page.
Bitcookie also seems to do a little bit of everything, and this is reflected in their imagery. They’ve got photos, screenshots, illustrations, and some images that are definitely stock. Despite all that, it works. It could easily have come out cluttered and disorganized; but Bitcookie’s site feels professional, imparting a feeling of trust.
That’s impressive.
McFadden/Gavender
McFadden/Gavender’s site is an excellent example of simplicity as opposed to minimalism. No one would accuse their site of being complex, but it feels “full”. There’s lots to see, but you’re not going to get lost.
WP Ninja
I’m a bit envious of WP Ninja because their site effortlessly pulls off something I’ve been attempting to create for years: a good looking “tilted” website. Every element is set at an angle, and it looks good.
Emilie Garnier
Emilie Garnier’s site is simple and pretty. Nothing revolutionary here. Just a site that looks good, works great, and introduces you to the Emilie’s elegant sense of style from the get-go.
Matthew Bambach
Matthew Bambach’s portfolio is boldly accented, perhaps saturated, with hot pink. Sometimes you’ll see hot pink around in different places, accompanied by dons of dark grey to balance it out.
Matthew put the site’s pinkness front and center, and it works for him.
The Internet of Things (IoT) has enabled the Internet to reach beyond the browser. Made up of electronically networked devices, these “things” are able to interact with the physical world via sensors that feed data they capture back into their ecosystems.
Currently, these devices are mostly products, designed with a specific purpose in mind, a typical example being a fitness band that tracks activity. It reports the information gathered to an app, which is then able to analyze the data and offer suggestions and motivation to push the user further.