The poem may begin on a somewhat sad note when the speaker claims that he "wandered lonely as a cloud," but the tone of the poem quickly becomes joyful, when he spies a group of daffodils "fluttering and dancing in the breeze." He claims that with such a sight "a poet could not but be gay," especially when he is in such "jocund company" as the numerous daffodils "tossing their heads in sprightly dance."
It is only later, though, that he fully appreciates the richness of this glorious sight. When he is in a "vacant or in pensive mood," the image of these daffodils flash in his "inward eye," and his heart is filled with pleasure and delight. It's a lovely poem showing the power of nature to transport us from loneliness, pensiveness, or emptiness to bliss.